-
Notifications
You must be signed in to change notification settings - Fork 42
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 <[email protected]> * robot decommission Signed-off-by: Aaron Chong <[email protected]> * icons Signed-off-by: Aaron Chong <[email protected]> * Remove unused components, test and storybook robot decommission and mutext table Signed-off-by: Aaron Chong <[email protected]> * Test mock posts Signed-off-by: Aaron Chong <[email protected]> * robot-summary Signed-off-by: Aaron Chong <[email protected]> * robots-table Signed-off-by: Aaron Chong <[email protected]> * cleaned up robots/utils, test compose-clean Signed-off-by: Aaron Chong <[email protected]> * custom-compose Signed-off-by: Aaron Chong <[email protected]> * patrol Signed-off-by: Aaron Chong <[email protected]> * delivery Signed-off-by: Aaron Chong <[email protected]> * delivery custom Signed-off-by: Aaron Chong <[email protected]> * task form, removed task details card, task logs app Signed-off-by: Aaron Chong <[email protected]> * task-inspector Signed-off-by: Aaron Chong <[email protected]> * task-summary Signed-off-by: Aaron Chong <[email protected]> * task-schedule Signed-off-by: Aaron Chong <[email protected]> * task-schedule-utils Signed-off-by: Aaron Chong <[email protected]> * tasks-window Signed-off-by: Aaron Chong <[email protected]> * alert-manager Signed-off-by: Aaron Chong <[email protected]> * alert-dialog Signed-off-by: Aaron Chong <[email protected]> * workspace and locally-persistent-workspace Signed-off-by: Aaron Chong <[email protected]> * task utils Signed-off-by: Aaron Chong <[email protected]> * cleanup negotiation manager Signed-off-by: Aaron Chong <[email protected]> * rmf-dashboard Signed-off-by: Aaron Chong <[email protected]> * Cleanup workcell-panel Signed-off-by: Aaron Chong <[email protected]> * utils geometry Signed-off-by: Aaron Chong <[email protected]> * favorite tasks, day selector switch, get default task request Signed-off-by: Aaron Chong <[email protected]> --------- Signed-off-by: Aaron Chong <[email protected]>
- 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.