Skip to content

Commit

Permalink
test(frontend): fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Falinor committed Jan 6, 2025
1 parent 369d6a9 commit 7b05a26
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions frontend/src/views/HousingList/HousingListView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ describe('Housing list view', () => {
it('should select all housings when the top checkbox gets checked', async () => {
setup();

const checkboxes = await within(
await screen.findByRole('table')
).findAllByRole('checkbox');
const [row] = await screen.findAllByRole('row');
const checkboxes = await within(row).findAllByRole('checkbox');
const [checkAll] = checkboxes;
await user.click(checkAll);
checkboxes.forEach((checkbox) => {
Expand All @@ -106,9 +105,8 @@ describe('Housing list view', () => {
it('should unselect all housings when the top checkbox is checked and clicked again', async () => {
setup();

const checkboxes = await within(
await screen.findByRole('table')
).findAllByRole('checkbox');
const [row] = await screen.findAllByRole('row');
const checkboxes = await within(row).findAllByRole('checkbox');
const [checkAll] = checkboxes;
await user.click(checkAll);
await user.click(checkAll);
Expand Down Expand Up @@ -141,8 +139,9 @@ describe('Housing list view', () => {
</Provider>
);

const panel = await screen.findByRole('tabpanel');
const [checkbox] = await within(panel).findAllByRole('checkbox');
const rows = await screen.findAllByRole('row');
const firstDataRow = rows[1]; // First row after the header row
const checkbox = await within(firstDataRow).findByRole('checkbox');
await user.click(checkbox);

const createCampaign = await screen.findByRole('button', {
Expand Down

0 comments on commit 7b05a26

Please sign in to comment.