-
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.
cleaned up robots/utils, test compose-clean
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
- Loading branch information
1 parent
30a8f17
commit cab75d3
Showing
3 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
packages/rmf-dashboard-framework/src/components/tasks/types/compose-clean.stories.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,19 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { ComposeCleanTaskForm, makeDefaultComposeCleanTaskDescription } from './compose-clean'; | ||
|
||
export default { | ||
title: 'Tasks/ComposeCleanTaskForm', | ||
component: ComposeCleanTaskForm, | ||
} satisfies Meta; | ||
|
||
type Story = StoryObj<typeof ComposeCleanTaskForm>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
taskDesc: makeDefaultComposeCleanTaskDescription(), | ||
cleaningZones: ['clean_zone_1', 'clean_zone_2'], | ||
onChange: () => {}, | ||
onValidate: () => {}, | ||
}, | ||
}; |
22 changes: 22 additions & 0 deletions
22
packages/rmf-dashboard-framework/src/components/tasks/types/compose-clean.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,22 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { describe, expect, it, vi } from 'vitest'; | ||
|
||
import { ComposeCleanTaskForm, makeDefaultComposeCleanTaskDescription } from './compose-clean'; | ||
|
||
describe('Compose clean task form', () => { | ||
it('Renders compose clean task form', async () => { | ||
const onChange = vi.fn(); | ||
const onValidate = vi.fn(); | ||
|
||
render( | ||
<ComposeCleanTaskForm | ||
taskDesc={makeDefaultComposeCleanTaskDescription()} | ||
cleaningZones={['test_clean_1', 'test_clean_2']} | ||
onChange={onChange} | ||
onValidate={onValidate} | ||
/>, | ||
); | ||
|
||
expect(screen.getByText('Cleaning Zone')).toBeDefined(); | ||
}); | ||
}); |