-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
59 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { route } from '../src/router/types/route'; | ||
|
||
test('should redirect from root to dashboard', async ({ page }) => { | ||
await page.goto(route.root); | ||
await expect(page).toHaveURL(route.dashboard); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { route } from '../src/router/types/route'; | ||
import { | ||
addSubscriptionButton, | ||
noSubscriptionsPlaceholder, | ||
subscriptionUpsertForm, | ||
} from '../src/subscriptions/globals/subscription.test-id'; | ||
|
||
test('should create subscription', async ({ page }) => { | ||
await page.goto(route.subscriptions); | ||
|
||
await expect( | ||
page.getByTestId(noSubscriptionsPlaceholder), | ||
`should have no subscriptions initially`, | ||
).toBeVisible(); | ||
|
||
await page.getByTestId(addSubscriptionButton).click(); | ||
|
||
await expect( | ||
page.getByTestId(subscriptionUpsertForm), | ||
`should show subscription upsert form`, | ||
).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const route = { | ||
root: '/', | ||
dashboard: '/dashboard', | ||
subscriptions: '/subscriptions', | ||
} as const; | ||
|
||
export type Route = (typeof route)[keyof typeof route]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const noSubscriptionsPlaceholder = | ||
'no-subscriptions-placeholder' as const; | ||
export const addSubscriptionButton = 'add-subscription-button' as const; | ||
export const subscriptionUpsertForm = 'subscription-upsert-form' as const; |