Skip to content

Commit

Permalink
fix(integration): fix broken integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bejoinka committed Oct 14, 2024
1 parent 271763b commit cff5a85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/atoms/ProviderSelection/ProviderSelection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ProviderSelectionSpec = async ({
autoClose?: boolean;
}) => {
const buttonText = button.innerText;
await expect(button).toHaveClass('bg-slate-300');
await expect(button).toHaveClass('border-slate-200');
await userEvent.click(button);
const closeButton = await canvas.findByLabelText('Close filter');
await expect(closeButton).toBeVisible();
Expand All @@ -42,16 +42,17 @@ export const ProviderSelectionSpec = async ({
await expect(filterButton).toHaveTextContent(filterName);
await userEvent.click(filterButton);
if (!autoClose) {
await expect(filterButton).toHaveClass('bg-primary');
await expect(filterButton).toHaveClass('ring-secondary');
await userEvent.click(closeButton);
}
await expect(filterButton).not.toBeVisible();
await expect(button).toHaveClass('bg-secondary');
await expect(button).toHaveClass('ring-secondary');
await expect(button).toHaveClass('text-primary');
const clearFilter = await canvas.findByLabelText(
`Clear ${buttonText} filter`
);
await userEvent.click(clearFilter);
await expect(button).toHaveClass('bg-slate-300');
await expect(button).toHaveClass('border-slate-200');
};
await testApplyFilter({
button: ethnicityButton,
Expand All @@ -75,7 +76,7 @@ export const ProviderSelectionSpec = async ({
});
await testApplyFilter({
button: locationButton,
filterName: 'NY - Union Square',
filterName: 'Union Square',
autoClose: true
});
};
6 changes: 3 additions & 3 deletions src/molecules/Scheduler/Scheduler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export const SchedulerSpec = async ({

/** Get all elements of interests */
const cherryCreekButton = await canvas.findByRole('button', {
name: 'CO - Cherry Creek'
name: 'Cherry Creek'
});
const unionSquareButton = await canvas.findByRole('button', {
name: 'NY - Union Square'
name: 'Union Square'
});
const virtualButton = await canvas.findByRole('button', {
name: 'Virtual'
name: 'Telehealth'
});
const prevWeekButton = await canvas.findByLabelText('Go to previous week');
const nextWeekButton = await canvas.findByLabelText('Go to next week');
Expand Down

0 comments on commit cff5a85

Please sign in to comment.