Skip to content

Commit

Permalink
Enable test in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Oct 7, 2022
1 parent ef30f46 commit f6dfccc
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions test/e2e/app-dir/index.test.ts
Expand Up @@ -1436,31 +1436,42 @@ describe('app dir', () => {
})

// TODO-APP: disable failing test and investigate later
it.skip('should render the template that is a server component and rerender on navigation', async () => {
const browser = await webdriver(next.url, '/template/servercomponent')
expect(await browser.elementByCss('h1').text()).toStartWith('Template')
;(isDev ? it.skip : it)(
'should render the template that is a server component and rerender on navigation',
async () => {
const browser = await webdriver(next.url, '/template/servercomponent')
// eslint-disable-next-line jest/no-standalone-expect
expect(await browser.elementByCss('h1').text()).toStartWith(
'Template'
)

const currentTime = await browser
.elementByCss('#performance-now')
.text()
const currentTime = await browser
.elementByCss('#performance-now')
.text()

await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#other-page')
await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#other-page')

expect(await browser.elementByCss('h1').text()).toStartWith('Template')
// eslint-disable-next-line jest/no-standalone-expect
expect(await browser.elementByCss('h1').text()).toStartWith(
'Template'
)

// template should rerender on navigation even when it's a server component
expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime
)
// template should rerender on navigation even when it's a server component
// eslint-disable-next-line jest/no-standalone-expect
expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime
)

await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#page')
await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#page')

expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime
)
})
// eslint-disable-next-line jest/no-standalone-expect
expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime
)
}
)
})

// TODO-APP: This is disabled for development as the error overlay needs to be reworked.
Expand Down

0 comments on commit f6dfccc

Please sign in to comment.