-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More testing and cleanup of legacy components (#1039)
* Remove low resolution custom behaviors Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * robot decommission Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * icons Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Remove unused components, test and storybook robot decommission and mutext table Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Test mock posts Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * robot-summary Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * robots-table Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * cleaned up robots/utils, test compose-clean Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * custom-compose Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * patrol Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * delivery Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * delivery custom Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * task form, removed task details card, task logs app Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * task-inspector Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * task-summary Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * task-schedule Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * task-schedule-utils Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * tasks-window Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * alert-manager Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * alert-dialog Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * workspace and locally-persistent-workspace Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * task utils Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * cleanup negotiation manager Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * rmf-dashboard Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Cleanup workcell-panel Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * utils geometry Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * favorite tasks, day selector switch, get default task request Signed-off-by: Aaron Chong <aaronchongth@gmail.com> --------- Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
- Loading branch information
1 parent
1a9d593
commit c7ef8d6
Showing
70 changed files
with
2,770 additions
and
1,368 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
packages/rmf-dashboard-framework/src/components/alert-manager.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { AlertRequest, ApiServerModelsAlertsAlertRequestTier } from 'api-client'; | ||
import React from 'react'; | ||
import { describe, expect, it, vi } from 'vitest'; | ||
|
||
import { RmfApiProvider } from '../hooks'; | ||
import { MockRmfApi, render, TestProviders } from '../utils/test-utils.test'; | ||
import { AlertDialog, AlertManager } from './alert-manager'; | ||
|
||
describe('Alert dialog', () => { | ||
const rmfApi = new MockRmfApi(); | ||
rmfApi.alertsApi.getAlertResponseAlertsRequestAlertIdResponseGet = vi | ||
.fn() | ||
.mockResolvedValue({ data: [] }); | ||
rmfApi.tasksApi.getTaskLogTasksTaskIdLogGet = () => new Promise(() => {}); | ||
|
||
const Base = (props: React.PropsWithChildren<{}>) => { | ||
return ( | ||
<TestProviders> | ||
<RmfApiProvider value={rmfApi}>{props.children}</RmfApiProvider> | ||
</TestProviders> | ||
); | ||
}; | ||
|
||
it('renders without crashing', () => { | ||
const alertRequest: AlertRequest = { | ||
id: 'test-alert', | ||
unix_millis_alert_time: 0, | ||
title: 'Test Alert', | ||
subtitle: 'Test subtitle', | ||
message: 'This is a test alert', | ||
tier: ApiServerModelsAlertsAlertRequestTier.Error, | ||
responses_available: ['ok'], | ||
display: true, | ||
task_id: 'test-task', | ||
alert_parameters: [], | ||
}; | ||
const onDismiss = vi.fn(); | ||
|
||
const root = render( | ||
<Base> | ||
<AlertDialog alertRequest={alertRequest} onDismiss={onDismiss} /> | ||
</Base>, | ||
); | ||
expect(root.getByText('Test Alert')).toBeTruthy(); | ||
expect(root.getByText('This is a test alert')).toBeTruthy(); | ||
expect(root.getByTestId('test-alert-ok-button')).toBeTruthy(); | ||
expect(root.getByTestId('task-cancel-button')).toBeTruthy(); | ||
expect(root.getByTestId('dismiss-button')).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
describe('Alert manager', () => { | ||
const rmfApi = new MockRmfApi(); | ||
rmfApi.alertsApi.getAlertResponseAlertsRequestAlertIdResponseGet = vi | ||
.fn() | ||
.mockResolvedValue({ data: [] }); | ||
rmfApi.tasksApi.getTaskLogTasksTaskIdLogGet = () => new Promise(() => {}); | ||
|
||
const Base = (props: React.PropsWithChildren<{}>) => { | ||
return ( | ||
<TestProviders> | ||
<RmfApiProvider value={rmfApi}>{props.children}</RmfApiProvider> | ||
</TestProviders> | ||
); | ||
}; | ||
|
||
it('starts without crashing', () => { | ||
render( | ||
<Base> | ||
<AlertManager /> | ||
</Base>, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/rmf-dashboard-framework/src/components/icons/CloseFullscreen.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './CloseFullscreen'; | ||
export * from './OpenInFull'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.