Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions e2e/react-router/basic-file-based/tests/params.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ test.describe('Unicode params', () => {
await fooLink.click()
await page.waitForURL('/params-ps/named/foo%25%5C%2F%F0%9F%9A%80%EB%8C%80')

expect(page.url()).toBe(
await expect(page).toHaveURL(
`${baseURL}/params-ps/named/foo%25%5C%2F%F0%9F%9A%80%EB%8C%80`,
)

Expand All @@ -403,7 +403,7 @@ test.describe('Unicode params', () => {
'/params-ps/named/foo%25%5C%2F%F0%9F%9A%80%EB%8C%80/%F0%9F%9A%80%252F%2Fabc%EB%8C%80',
)

expect(page.url()).toBe(
await expect(page).toHaveURL(
`${baseURL}/params-ps/named/foo%25%5C%2F%F0%9F%9A%80%EB%8C%80/%F0%9F%9A%80%252F%2Fabc%EB%8C%80`,
)

Expand Down Expand Up @@ -441,7 +441,7 @@ test.describe('Unicode params', () => {

const headingRootEl = page.getByTestId('unicode-heading')

expect(await headingRootEl.innerText()).toBe('Hello "/대한민국"!')
await expect(headingRootEl).toHaveText('Hello "/대한민국"!')

const latinLink = page.getByTestId(`l-to-${name}-latin`)
const unicodeLink = page.getByTestId(`l-to-${name}-unicode`)
Expand All @@ -453,7 +453,7 @@ test.describe('Unicode params', () => {

await page.waitForURL(`${encodedChildRoutePath}/${latinParams}`)

expect(page.url()).toBe(
await expect(page).toHaveURL(
`${baseURL}${encodedChildRoutePath}/${latinParams}`,
)

Expand All @@ -463,10 +463,10 @@ test.describe('Unicode params', () => {
const headingEl = page.getByTestId(`unicode-${name}-heading`)
const paramsEl = page.getByTestId(`unicode-${name}-params`)

expect(await headingEl.innerText()).toBe(
await expect(headingEl).toHaveText(
`Unicode ${pascalCaseName} Params`,
)
expect(await paramsEl.innerText()).toBe(latinParams)
await expect(paramsEl).toHaveText(latinParams)

await unicodeLink.click()

Expand All @@ -477,17 +477,17 @@ test.describe('Unicode params', () => {

await page.waitForURL(`${encodedChildRoutePath}/${encodedParams}`)

expect(page.url()).toBe(
await expect(page).toHaveURL(
`${baseURL}${encodedChildRoutePath}/${encodedParams}`,
)

await expect(latinLink).not.toContainClass('font-bold')
await expect(unicodeLink).toContainClass('font-bold')

expect(await headingEl.innerText()).toBe(
await expect(headingEl).toHaveText(
`Unicode ${pascalCaseName} Params`,
)
expect(await paramsEl.innerText()).toBe(unicodeParams)
await expect(paramsEl).toHaveText(unicodeParams)
})
})
})
Expand Down
6 changes: 3 additions & 3 deletions e2e/react-start/basic-auth/tests/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ test('Posts redirects to login when not authenticated', async ({ page }) => {

test('Login fails with user not found', async ({ page }) => {
await login(page, 'bad@gmail.com', 'badpassword')
expect(page.getByText('User not found')).toBeTruthy()
await expect(page.getByText('User not found')).toBeVisible()
})

test('Login fails with incorrect password', async ({ page }) => {
await signup(page, 'test@gmail.com', 'badpassword')
expect(page.getByText('Incorrect password')).toBeTruthy()
await expect(page.getByText('Incorrect password')).toBeVisible()
})

test('Can sign up from a not found user', async ({ page }) => {
await login(page, 'test2@gmail.com', 'badpassword', true)
expect(page.getByText('test@gmail.com')).toBeTruthy()
await expect(page.getByText('test2@gmail.com')).toBeVisible()
})

test('Navigating to post after logging in', async ({ page }) => {
Expand Down
8 changes: 4 additions & 4 deletions e2e/react-start/custom-basepath/tests/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ test('client-side redirect', async ({ page, baseURL }) => {
await page.getByTestId('link-to-throw-it').click()
await page.waitForLoadState('networkidle')

expect(await page.getByTestId('post-view').isVisible()).toBe(true)
expect(page.url()).toBe(`${baseURL}/posts/1`)
await expect(page.getByTestId('post-view')).toBeVisible()
await expect(page).toHaveURL(`${baseURL}/posts/1`)
})

test('server-side redirect', async ({ page, baseURL }) => {
await page.goto('/redirect/throw-it')
await page.waitForLoadState('networkidle')

expect(await page.getByTestId('post-view').isVisible()).toBe(true)
expect(page.url()).toBe(`${baseURL}/posts/1`)
await expect(page.getByTestId('post-view')).toBeVisible()
await expect(page).toHaveURL(`${baseURL}/posts/1`)

// do not follow redirects since we want to test the Location header
// first go to the route WITHOUT the base path, this will just add the base path
Expand Down
12 changes: 6 additions & 6 deletions e2e/solid-router/basic-file-based/tests/transition.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('transitions/count/create-resource should keep old values visible during na

// 1 click

page.getByTestId('increase-button').click()
await page.getByTestId('increase-button').click()

await expect(page.getByTestId('n-value')).toContainText('n: 1', {
timeout: 2_000,
Expand All @@ -40,8 +40,8 @@ test('transitions/count/create-resource should keep old values visible during na

// 2 clicks

page.getByTestId('increase-button').click()
page.getByTestId('increase-button').click()
await page.getByTestId('increase-button').click()
await page.getByTestId('increase-button').click()

await expect(page.getByTestId('n-value')).toContainText('n: 2', {
timeout: 2000,
Expand All @@ -61,9 +61,9 @@ test('transitions/count/create-resource should keep old values visible during na

// 3 clicks

page.getByTestId('increase-button').click()
page.getByTestId('increase-button').click()
page.getByTestId('increase-button').click()
await page.getByTestId('increase-button').click()
await page.getByTestId('increase-button').click()
await page.getByTestId('increase-button').click()

await expect(page.getByTestId('n-value')).toContainText('n: 4', {
timeout: 2000,
Expand Down