Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tco committed Jul 31, 2023
1 parent d5e87c0 commit b2265a5
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,15 @@ const getMockDepartmentData = () => [
describe('Edit department information page', () => {
test('Should navigate to change user department when provided a userId', async () => {
render(
<ManageDepartmentsPage
formAction="."
pageData={{ departments: getMockDepartmentData(), userId: '1' }}
previousValues={getMockDepartmentData()[0]}
csrfToken="csrf"
fieldErrors={[]}
/>
<ManageDepartmentsPage departments={getMockDepartmentData()} userId="1" />
);
expect(screen.getByText('Back').getAttribute('href')).toBe(
'/apply/super-admin-dashboard/user/1/change-department'
);
});
test('Should navigate to dashboard when not provided a userId', async () => {
render(
<ManageDepartmentsPage
formAction="."
pageData={{ departments: getMockDepartmentData(), userId: '' }}
previousValues={getMockDepartmentData()[0]}
csrfToken="csrf"
fieldErrors={[]}
/>
<ManageDepartmentsPage departments={getMockDepartmentData()} userId="" />
);
expect(screen.getByText('Back').getAttribute('href')).toBe(
'/apply/super-admin-dashboard/'
Expand Down

0 comments on commit b2265a5

Please sign in to comment.