Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix tests for vue 3.4.3 #24985

Merged
merged 3 commits into from
Jan 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1459,21 +1459,23 @@ describe.skipIf(isDev() || isWebpack)('inlining component styles', () => {
describe('server components/islands', () => {
it('/islands', async () => {
const { page } = await renderPage('/islands')
const islandRequest = page.waitForResponse(response => response.url().includes('/__nuxt_island/') && response.status() === 200)
await page.locator('#increase-pure-component').click()
await page.waitForResponse(response => response.url().includes('/__nuxt_island/') && response.status() === 200)

await islandRequest
await page.locator('#slot-in-server').getByText('Slot with in .server component').waitFor()
await page.locator('#test-slot').getByText('Slot with name test').waitFor()

// test fallback slot with v-for
expect(await page.locator('.fallback-slot-content').all()).toHaveLength(2)
// test islands update
expect(await page.locator('.box').innerHTML()).toContain('"number": 101,')
await page.locator('#update-server-components').click()
await Promise.all([
const requests = [
page.waitForResponse(response => response.url().includes('/__nuxt_island/LongAsyncComponent') && response.status() === 200),
page.waitForResponse(response => response.url().includes('/__nuxt_island/AsyncServerComponent') && response.status() === 200)
])
]
await page.locator('#update-server-components').click()
await Promise.all(requests)

await page.locator('#async-server-component-count').getByText('1').waitFor()
await page.locator('#long-async-component-count').getByText('1').waitFor()
Expand Down Expand Up @@ -1958,11 +1960,12 @@ describe('component islands', () => {

// test islands update
expect(await page.locator('.box').innerHTML()).toContain('"number": 101,')
await page.locator('#update-server-components').click()
await Promise.all([
const islandRequests = [
page.waitForResponse(response => response.url().includes('/__nuxt_island/LongAsyncComponent') && response.status() === 200),
page.waitForResponse(response => response.url().includes('/__nuxt_island/AsyncServerComponent') && response.status() === 200)
])
]
await page.locator('#update-server-components').click()
await Promise.all(islandRequests)

await page.locator('#long-async-component-count').getByText('1').waitFor()

Expand Down