Skip to content

Commit

Permalink
gitchore: sticky header on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
RRanath committed Aug 29, 2024
1 parent d9d0a40 commit 60ab19f
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion app/tests/pages/analyst/dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ describe('The index page', () => {
pageTestingHelper.renderPage();

const countRows = screen.getAllByText(/Showing 8 of 8 rows/i);
expect(countRows).toHaveLength(2);
expect(countRows).toHaveLength(1);
});

it('click on table row leads to review page', async () => {
Expand Down Expand Up @@ -693,6 +693,46 @@ describe('The index page', () => {
expect(screen.queryByText('BC-000074')).not.toBeInTheDocument();
});

it('correctly sorts status columns based on custom order', async () => {
jest
.spyOn(moduleApi, 'useFeature')
.mockReturnValue(mockShowCbcProjects(true));

pageTestingHelper.loadQuery();
pageTestingHelper.renderPage();

expect(screen.getByText('5555')).toBeInTheDocument();
expect(screen.queryByText('CCBC-010004')).toBeInTheDocument();
expect(screen.queryByText('BC-000074')).toBeInTheDocument();
const cbcFilterCheckbox = screen.getByTestId('programFilterCbc');
const ccbcFilterCheckbox = screen.getByTestId('programFilterCcbc');
const otherFilterCheckbox = screen.getByTestId('programFilterOther');
expect(cbcFilterCheckbox).toBeChecked();
expect(ccbcFilterCheckbox).toBeChecked();
expect(otherFilterCheckbox).toBeChecked();

await act(async () => {
fireEvent.click(cbcFilterCheckbox);
});
expect(cbcFilterCheckbox).not.toBeChecked();

expect(screen.queryByText('5555')).not.toBeInTheDocument();

await act(async () => {
fireEvent.click(ccbcFilterCheckbox);
});
expect(ccbcFilterCheckbox).not.toBeChecked();

expect(screen.queryByText('CCBC-010004')).not.toBeInTheDocument();

await act(async () => {
fireEvent.click(otherFilterCheckbox);
});
expect(otherFilterCheckbox).not.toBeChecked();

expect(screen.queryByText('BC-000074')).not.toBeInTheDocument();
});

it('clear filters correctly restore project type filter', async () => {
jest
.spyOn(moduleApi, 'useFeature')
Expand Down

0 comments on commit 60ab19f

Please sign in to comment.