mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
test: use locator assertion for body text
This commit is contained in:
parent
9b5bffbbb4
commit
3d77e267d8
@ -411,6 +411,7 @@ describe('pages', () => {
|
|||||||
|
|
||||||
it('/wrapper-expose/page', async () => {
|
it('/wrapper-expose/page', async () => {
|
||||||
const { page, pageErrors, consoleLogs } = await renderPage('/wrapper-expose/page')
|
const { page, pageErrors, consoleLogs } = await renderPage('/wrapper-expose/page')
|
||||||
|
await page.waitForLoadState('networkidle')
|
||||||
await page.locator('#log-foo').click()
|
await page.locator('#log-foo').click()
|
||||||
expect(consoleLogs.at(-1)?.text).toBe('bar')
|
expect(consoleLogs.at(-1)?.text).toBe('bar')
|
||||||
// change page
|
// change page
|
||||||
@ -2497,9 +2498,8 @@ describe('teleports', () => {
|
|||||||
describe('Node.js compatibility for client-side', () => {
|
describe('Node.js compatibility for client-side', () => {
|
||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
const { page } = await renderPage('/node-compat')
|
const { page } = await renderPage('/node-compat')
|
||||||
const html = await page.innerHTML('body')
|
await page.locator('body').getByText('Nuxt is Awesome!').waitFor()
|
||||||
expect(html).toContain('Nuxt is Awesome!')
|
expect(await page.innerHTML('body')).toContain('CWD: [available]')
|
||||||
expect(html).toContain('CWD: [available]')
|
|
||||||
await page.close()
|
await page.close()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user