Skip to content

Commit

Permalink
Hide toasts in CI fast
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvonen committed Dec 13, 2024
1 parent e1d9cec commit 767c68e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
6 changes: 0 additions & 6 deletions e2e/log.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ test('logs veggies', async ({page}) => {
'This Week 2 Veggies',
);

const elements = await page.getByTestId('toast-message').all();
for (const element of elements) {
await element.click();
}

await expect(page.getByTestId('toast-message')).toBeHidden();
await page.getByTestId('navbar-link-settings').click();
await page.getByTestId('navbar-link-log').click();
await expect(page.getByTestId('category-status-chart-center-label')).toHaveText(
Expand Down
4 changes: 0 additions & 4 deletions e2e/stats.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ test("shows current week's veggies", async ({page}) => {
await page.getByText(/^apple$/).click();
await page.getByText('Apricot').click();
await page.getByText('Avocado').click();
const elements = await page.getByTestId('toast-message').all();
for (const element of elements) {
await element.click();
}
await page.getByTestId('navbar-link-stats').click();
await expect(page.getByTestId('tag-apple')).toBeVisible();
await expect(page.getByTestId('tag-apricot')).toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions src/components/ToastMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ defineProps<{
const emit = defineEmits(['close']);
const toastMessage = ref<HTMLDivElement | null>(null);
const {start, stop} = useTimeout(5500, {
const toastTimeout = import.meta.env.MODE === 'staging' ? 100 : 5500;
const {start, stop} = useTimeout(toastTimeout, {
callback: () => emit('close'),
controls: true,
});
Expand Down

0 comments on commit 767c68e

Please sign in to comment.