Skip to content

Commit

Permalink
Aaron/react 18 (#729)
Browse files Browse the repository at this point in the history
* Adding link to unresolved issue to testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added back missing test

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reverting stack navigator tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove the rest of reporting components from react-components

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove deprecated command forms

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert to remove expectation of loading text since that is not what we are testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Add DashboardRoute to the route map since it returns undefined anyway

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth authored Jul 27, 2023
1 parent 178f6d1 commit 8e62a77
Show file tree
Hide file tree
Showing 76 changed files with 43 additions and 4,170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import React from 'react';
import { getActionText, RmfAction } from '../../permissions';
import { PermissionsCard } from '../permissions-card';

// TODO(AA): To remove after
// https://github.com/testing-library/react-testing-library/issues/1216
// has been resolved.
// Workaround for "Warning: An update to ComponentName inside a test was not
// wrapped in act(...)."
const originalError = console.error;
beforeAll(() => {
// this is just a little hack to silence
// Warning: An update to ComponentName inside a test was not wrapped in act(...).
console.error = (...args) => {
if (/Warning.*not wrapped in act/.test(args[0])) {
return;
Expand Down
3 changes: 2 additions & 1 deletion packages/dashboard/src/components/appbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export type TabValue = 'infrastructure' | 'robots' | 'tasks' | 'custom1' | 'cust

const locationToTabValue = (pathname: string): TabValue | undefined => {
const routes: { prefix: string; tabValue: TabValue }[] = [
{ prefix: DashboardRoute, tabValue: 'infrastructure' },
{ prefix: RobotsRoute, tabValue: 'robots' },
{ prefix: TasksRoute, tabValue: 'tasks' },
{ prefix: CustomRoute1, tabValue: 'custom1' },
Expand All @@ -79,7 +80,7 @@ const locationToTabValue = (pathname: string): TabValue | undefined => {

// `DashboardRoute` being the root, it is a prefix to all routes, so we need to check exactly.
const matchingRoute = routes.find((route) => pathname.startsWith(route.prefix));
return pathname === DashboardRoute ? 'infrastructure' : matchingRoute?.tabValue;
return matchingRoute?.tabValue;
};

function AppSettings() {
Expand Down
26 changes: 0 additions & 26 deletions packages/react-components/lib/commands/command-forms.stories.tsx

This file was deleted.

165 changes: 0 additions & 165 deletions packages/react-components/lib/commands/delivery-request-form.spec.tsx

This file was deleted.

Loading

0 comments on commit 8e62a77

Please sign in to comment.