Unverified Commit ef416079 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

re-enable middleware deploy tests (#73744)

This was fixed upstream, so we can re-enable the deployment tests for
it.
parent 16bfce64
...@@ -6,7 +6,7 @@ import { nextTestSetup, FileRef } from 'e2e-utils' ...@@ -6,7 +6,7 @@ import { nextTestSetup, FileRef } from 'e2e-utils'
import type { Response } from 'node-fetch' import type { Response } from 'node-fetch'
describe('app-dir with middleware', () => { describe('app-dir with middleware', () => {
const { next, isNextDeploy } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -187,28 +187,25 @@ describe('app-dir with middleware', () => { ...@@ -187,28 +187,25 @@ describe('app-dir with middleware', () => {
await browser.deleteCookies() await browser.deleteCookies()
}) })
// TODO: Re-enable this test in deploy mode once Vercel has proper handling it('should omit internal headers for middleware cookies', async () => {
if (!isNextDeploy) { const response = await next.fetch('/rsc-cookies/cookie-options')
it('should omit internal headers for middleware cookies', async () => { expect(response.status).toBe(200)
const response = await next.fetch('/rsc-cookies/cookie-options') expect(response.headers.get('x-middleware-set-cookie')).toBeNull()
expect(response.status).toBe(200) })
expect(response.headers.get('x-middleware-set-cookie')).toBeNull()
})
it('should ignore x-middleware-set-cookie as a request header', async () => { it('should ignore x-middleware-set-cookie as a request header', async () => {
const $ = await next.render$( const $ = await next.render$(
'/cookies', '/cookies',
{}, {},
{ {
headers: { headers: {
'x-middleware-set-cookie': 'test', 'x-middleware-set-cookie': 'test',
}, },
} }
) )
expect($('#cookies').text()).toBe('cookies: 0') expect($('#cookies').text()).toBe('cookies: 0')
}) })
}
it('should be possible to read cookies that are set during the middleware handling of a server action', async () => { it('should be possible to read cookies that are set during the middleware handling of a server action', async () => {
const browser = await next.browser('/rsc-cookies') const browser = await next.browser('/rsc-cookies')
......
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