Skip to content

Commit

Permalink
Consolidate CivicProfile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sterner committed Aug 7, 2024
1 parent 32dacb9 commit e119e7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
13 changes: 13 additions & 0 deletions test/pages/CivicProfile.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BrowserRouter } from 'react-router-dom';
import { render } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { CivicProfile } from '@pages';
import { CIVIC_FORM_LIST } from '@components/CivicProfileForms';
import createMatchMedia from '../helpers/createMatchMedia';

// TODO: Rewrite tests to align with changes in CivicProfile component
Expand All @@ -21,6 +22,7 @@ describe.todo('CivicProfile Page', () => {
expect(componentContainerStyles.flexDirection).toBe('row');
expect(navContainerStyles.width).toBe('25%');
});

it('renders page container flex direction as column and nav container width as 100% below 600px', () => {
window.matchMedia = createMatchMedia(599);
const component = render(
Expand All @@ -35,4 +37,15 @@ describe.todo('CivicProfile Page', () => {
expect(componentContainerStyles.flexDirection).toBe('column');
expect(navContainerStyles.width).toBe('100%');
});

it('renders buttons for all forms in CIVIC_FORM_LIST', () => {
const numLinks = CIVIC_FORM_LIST.length;
const { getByRole, getAllByRole } = render(
<BrowserRouter>
<CivicProfile />
</BrowserRouter>
);
expect(getByRole('navigation')).not.toBeNull();
expect(getAllByRole('tab').length).toEqual(numLinks);
});
});
22 changes: 0 additions & 22 deletions test/pages/PersonalProfile.test.jsx

This file was deleted.

0 comments on commit e119e7d

Please sign in to comment.