Skip to content

Commit

Permalink
DESENG-489: engagement core to engagement content (#2371)
Browse files Browse the repository at this point in the history
* DESENG-489: engagement core to engagement content

* Adding unit test

* Space correction
  • Loading branch information
ratheesh-aot authored Feb 1, 2024
1 parent e6a7470 commit 7baa5e5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## February 01, 2024
- **Task** Change name from "Engagement Core" to "Engagement Content". [🎟️DESENG-489](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-489)

## January 29, 2024
- **Task** Updated Babel Traverse library. [🎟️DESENG-474](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-474)
- Run `npm audit fix` to update the vulnerable Babel traverse library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import EngagementAdditionalDetails from './AdditionalDetails';
import EngagementSettings from './Settings';

const FormTabs = () => {
const [value, setValue] = React.useState<EngagementFormTabValues>(ENGAGEMENT_FORM_TABS.CORE);
const [value, setValue] = React.useState<EngagementFormTabValues>(ENGAGEMENT_FORM_TABS.CONTENT);

return (
<Box sx={{ width: '100%', typography: 'body1' }}>
Expand All @@ -24,13 +24,13 @@ const FormTabs = () => {
}}
variant="scrollable"
>
<MetTab label="Engagement Core" value={ENGAGEMENT_FORM_TABS.CORE} />
<MetTab label="Engagement Content" value={ENGAGEMENT_FORM_TABS.CONTENT} />
<MetTab label="Additional Details" value={ENGAGEMENT_FORM_TABS.ADDITIONAL} />
<MetTab label="User Management" value={ENGAGEMENT_FORM_TABS.USER_MANAGEMENT} />
<MetTab label="Settings" value={ENGAGEMENT_FORM_TABS.SETTINGS} />
</MetTabList>
</Box>
<MetTabPanel value={ENGAGEMENT_FORM_TABS.CORE}>
<MetTabPanel value={ENGAGEMENT_FORM_TABS.CONTENT}>
<EngagementForm />
</MetTabPanel>
<MetTabPanel value={ENGAGEMENT_FORM_TABS.ADDITIONAL}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type EngagementFormTabValues = 'core' | 'settings' | 'User Management' | 'additional';
export type EngagementFormTabValues = 'content' | 'settings' | 'User Management' | 'additional';

export const ENGAGEMENT_FORM_TABS: { [x: string]: EngagementFormTabValues } = {
CORE: 'core',
CONTENT: 'content',
ADDITIONAL: 'additional',
USER_MANAGEMENT: 'User Management',
SETTINGS: 'settings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ describe('Engagement form page tests', () => {
setupEnv();
});

test('Engagement form tabs and their titles should be populated correctly', async () => {
useParamsMock.mockReturnValue({ engagementId: '1' });
render(<EngagementForm />);

await waitFor(() => {
expect(screen.getByText('Engagement Content')).toBeInTheDocument();
});

expect(screen.getByText('Additional Details')).toBeInTheDocument();
expect(screen.getByText('User Management')).toBeInTheDocument();
expect(screen.getByText('Settings')).toBeInTheDocument();
});

test('Engagement form with saved engagement should display saved info', async () => {
useParamsMock.mockReturnValue({ engagementId: '1' });
render(<EngagementForm />);
Expand Down

0 comments on commit 7baa5e5

Please sign in to comment.