Skip to content

Commit

Permalink
feat(nuxt): set route announcer (#835)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Improved layout structure for enhanced accessibility and visual
organization in the application.
- **Bug Fixes**
- Enhanced robustness of toast notification visibility checks in
testing, reducing false negatives.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
antoinezanardi authored Sep 9, 2024
1 parent f611995 commit dd1115f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 60 deletions.
14 changes: 9 additions & 5 deletions app/app.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<template>
<NuxtLayout>
<NuxtPage
class="h-full md:p-2 p-4"
/>
<div class="h-full">
<NuxtRouteAnnouncer/>

<NuxtLayout>
<NuxtPage
class="h-full md:p-2 p-4"
/>
</NuxtLayout>

<PrimeVueToast position="bottom-right"/>

<NuxtPwaManifest/>
</NuxtLayout>
</div>
</template>

<script lang="ts" setup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ import { expect } from "@playwright/test";
import type { CustomWorld } from "@tests/acceptance/shared/types/word.types";

Then(/^the toast with text "(?<text>.+)" should be visible$/u, async function(this: CustomWorld, text: string): Promise<void> {
await expect(this.page.getByRole("alert").getByText(text)).toBeVisible();
const toastsContainer = this.page.locator(".p-toast").first();

await expect(toastsContainer.getByRole("alert").getByText(text)).toBeVisible();
});
Loading

0 comments on commit dd1115f

Please sign in to comment.