Unverified Commit ce820e2a authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Enable passing tests (#41241)

parent b5590022
...@@ -259,7 +259,7 @@ describe('app dir', () => { ...@@ -259,7 +259,7 @@ describe('app dir', () => {
describe('rewrites', () => { describe('rewrites', () => {
// TODO-APP: rewrite url is broken // TODO-APP: rewrite url is broken
it.skip('should support rewrites on initial load', async () => { it('should support rewrites on initial load', async () => {
const browser = await webdriver(next.url, '/rewritten-to-dashboard') const browser = await webdriver(next.url, '/rewritten-to-dashboard')
expect(await browser.elementByCss('h1').text()).toBe('Dashboard') expect(await browser.elementByCss('h1').text()).toBe('Dashboard')
expect(await browser.url()).toBe(`${next.url}/rewritten-to-dashboard`) expect(await browser.url()).toBe(`${next.url}/rewritten-to-dashboard`)
...@@ -826,7 +826,7 @@ describe('app dir', () => { ...@@ -826,7 +826,7 @@ describe('app dir', () => {
describe('next/router', () => { describe('next/router', () => {
// `useRouter` should not be accessible in server components. // `useRouter` should not be accessible in server components.
it.skip('should always return null when accessed from /app', async () => { it('should always return null when accessed from /app', async () => {
const browser = await webdriver(next.url, '/old-router') const browser = await webdriver(next.url, '/old-router')
try { try {
...@@ -1436,9 +1436,14 @@ describe('app dir', () => { ...@@ -1436,9 +1436,14 @@ describe('app dir', () => {
}) })
// TODO-APP: disable failing test and investigate later // TODO-APP: disable failing test and investigate later
it.skip('should render the template that is a server component and rerender on navigation', async () => { ;(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') const browser = await webdriver(next.url, '/template/servercomponent')
expect(await browser.elementByCss('h1').text()).toStartWith('Template') // eslint-disable-next-line jest/no-standalone-expect
expect(await browser.elementByCss('h1').text()).toStartWith(
'Template'
)
const currentTime = await browser const currentTime = await browser
.elementByCss('#performance-now') .elementByCss('#performance-now')
...@@ -1447,9 +1452,13 @@ describe('app dir', () => { ...@@ -1447,9 +1452,13 @@ describe('app dir', () => {
await browser.elementByCss('#link').click() await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#other-page') 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 // 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( expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime currentTime
) )
...@@ -1457,10 +1466,12 @@ describe('app dir', () => { ...@@ -1457,10 +1466,12 @@ describe('app dir', () => {
await browser.elementByCss('#link').click() await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#page') await browser.waitForElementByCss('#page')
// eslint-disable-next-line jest/no-standalone-expect
expect(await browser.elementByCss('#performance-now').text()).toBe( expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime currentTime
) )
}) }
)
}) })
// TODO-APP: This is disabled for development as the error overlay needs to be reworked. // TODO-APP: This is disabled for development as the error overlay needs to be reworked.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment