Skip to content

Commit

Permalink
feat: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Oct 21, 2024
1 parent a7e6a34 commit 6ad5e93
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [ main ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 * * * *' # Run hourly
jobs:
test:
timeout-minutes: 60
Expand Down
1 change: 1 addition & 0 deletions src/app/components/PlaygroundFormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const PlaygroundFormContainer = () => {
</Tabs>
<Box p={3}>
<Button
data-testid="send-notification-button"
variant="white-outline"
size="md"
width="full"
Expand Down
25 changes: 25 additions & 0 deletions tests/inbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,28 @@ test("loads inbox playground", async ({ page }) => {
await expect(page.locator(".nv-notificationList")).toBeVisible();
await expect(page.locator(".nv-inboxStatus__title")).toBeVisible();
});

test("new notification notice is visible", async ({ page }) => {
await page.goto("/");

await page.waitForLoadState("networkidle");

await page.waitForSelector(".nv-notificationListNewNotificationsNotice__button", {
state: "visible",
timeout: 5000,
});
await page.locator("[data-testid='send-notification-button']").click();

await page.locator(".nv-notificationListNewNotificationsNotice__button").click();

await page.waitForSelector(".nv-notificationListNewNotificationsNotice__button", {
state: "hidden",
timeout: 5000,
});

await page.locator("[data-testid='send-notification-button']").click();
await page.waitForSelector(".nv-notificationListNewNotificationsNotice__button", {
state: "visible",
timeout: 5000,
});
});

0 comments on commit 6ad5e93

Please sign in to comment.