Unverified Commit 2277eb92 authored by Javi Velasco's avatar Javi Velasco Committed by GitHub

Enable appDir e2e deploy tests #1 (#41759)

Enables `appDir` test for `deploy` in the `test/e2e/app-dir/index.test.ts` test suite.
parent f5a89eb0
...@@ -15,12 +15,6 @@ import webdriver from 'next-webdriver' ...@@ -15,12 +15,6 @@ import webdriver from 'next-webdriver'
describe('app dir', () => { describe('app dir', () => {
const isDev = (global as any).isNextDev const isDev = (global as any).isNextDev
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
let next: NextInstance let next: NextInstance
function runTests() { function runTests() {
...@@ -139,6 +133,7 @@ describe('app dir', () => { ...@@ -139,6 +133,7 @@ describe('app dir', () => {
expect(html).toContain('hello from app/dashboard') expect(html).toContain('hello from app/dashboard')
}) })
if (!(global as any).isNextDeploy) {
it('should serve /index as separate page', async () => { it('should serve /index as separate page', async () => {
const html = await renderViaHTTP(next.url, '/dashboard/index') const html = await renderViaHTTP(next.url, '/dashboard/index')
expect(html).toContain('hello from app/dashboard/index') expect(html).toContain('hello from app/dashboard/index')
...@@ -155,6 +150,7 @@ describe('app dir', () => { ...@@ -155,6 +150,7 @@ describe('app dir', () => {
/<script src="\/_next\/static\/chunks\/polyfills(-\w+)?\.js" nomodule="">/ /<script src="\/_next\/static\/chunks\/polyfills(-\w+)?\.js" nomodule="">/
) )
}) })
}
// TODO-APP: handle css modules fouc in dev // TODO-APP: handle css modules fouc in dev
it.skip('should handle css imports in next/dynamic correctly', async () => { it.skip('should handle css imports in next/dynamic correctly', async () => {
...@@ -402,6 +398,7 @@ describe('app dir', () => { ...@@ -402,6 +398,7 @@ describe('app dir', () => {
}) })
describe('parallel routes', () => { describe('parallel routes', () => {
if (!(global as any).isNextDeploy) {
it('should match parallel routes', async () => { it('should match parallel routes', async () => {
const html = await renderViaHTTP(next.url, '/parallel/nested') const html = await renderViaHTTP(next.url, '/parallel/nested')
expect(html).toContain('parallel/layout') expect(html).toContain('parallel/layout')
...@@ -413,6 +410,7 @@ describe('app dir', () => { ...@@ -413,6 +410,7 @@ describe('app dir', () => {
expect(html).toContain('parallel/@bar/nested/@b/page') expect(html).toContain('parallel/@bar/nested/@b/page')
expect(html).toContain('parallel/nested/page') expect(html).toContain('parallel/nested/page')
}) })
}
it('should match parallel routes in route groups', async () => { it('should match parallel routes in route groups', async () => {
const html = await renderViaHTTP(next.url, '/parallel/nested-2') const html = await renderViaHTTP(next.url, '/parallel/nested-2')
...@@ -1172,6 +1170,7 @@ describe('app dir', () => { ...@@ -1172,6 +1170,7 @@ describe('app dir', () => {
} }
}) })
if (!(global as any).isNextDeploy) {
it('should have consistent query and params handling', async () => { it('should have consistent query and params handling', async () => {
const html = await renderViaHTTP( const html = await renderViaHTTP(
next.url, next.url,
...@@ -1182,6 +1181,7 @@ describe('app dir', () => { ...@@ -1182,6 +1181,7 @@ describe('app dir', () => {
expect(el.attr('data-params')).toBe('params') expect(el.attr('data-params')).toBe('params')
expect(el.attr('data-query')).toBe('query') expect(el.attr('data-query')).toBe('query')
}) })
}
}) })
describe('useSelectedLayoutSegment', () => { describe('useSelectedLayoutSegment', () => {
...@@ -1905,6 +1905,7 @@ describe('app dir', () => { ...@@ -1905,6 +1905,7 @@ describe('app dir', () => {
}) })
describe('bots', () => { describe('bots', () => {
if (!(global as any).isNextDeploy) {
it('should block rendering for bots and return 404 status', async () => { it('should block rendering for bots and return 404 status', async () => {
const res = await fetchViaHTTP( const res = await fetchViaHTTP(
next.url, next.url,
...@@ -1920,6 +1921,7 @@ describe('app dir', () => { ...@@ -1920,6 +1921,7 @@ describe('app dir', () => {
expect(res.status).toBe(404) expect(res.status).toBe(404)
expect(await res.text()).toInclude('"noindex"') expect(await res.text()).toInclude('"noindex"')
}) })
}
}) })
describe('redirect', () => { describe('redirect', () => {
...@@ -2038,6 +2040,7 @@ describe('app dir', () => { ...@@ -2038,6 +2040,7 @@ describe('app dir', () => {
}) })
describe('next/script', () => { describe('next/script', () => {
if (!(global as any).isNextDeploy) {
it('should support next/script and render in correct order', async () => { it('should support next/script and render in correct order', async () => {
const browser = await webdriver(next.url, '/script') const browser = await webdriver(next.url, '/script')
...@@ -2054,6 +2057,7 @@ describe('app dir', () => { ...@@ -2054,6 +2057,7 @@ describe('app dir', () => {
4, 4,
]) ])
}) })
}
it('should insert preload tags for beforeInteractive and afterInteractive scripts', async () => { it('should insert preload tags for beforeInteractive and afterInteractive scripts', async () => {
const html = await renderViaHTTP(next.url, '/script') const html = await renderViaHTTP(next.url, '/script')
......
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