Skip to content

Commit

Permalink
re-enable middleware deploy tests (#73744)
Browse files Browse the repository at this point in the history
This was fixed upstream, so we can re-enable the deployment tests for
it.
  • Loading branch information
ztanner authored Dec 10, 2024
1 parent 16bfce6 commit ef41607
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions test/e2e/app-dir/app-middleware/app-middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { nextTestSetup, FileRef } from 'e2e-utils'
import type { Response } from 'node-fetch'

describe('app-dir with middleware', () => {
const { next, isNextDeploy } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
})

Expand Down Expand Up @@ -187,28 +187,25 @@ describe('app-dir with middleware', () => {
await browser.deleteCookies()
})

// TODO: Re-enable this test in deploy mode once Vercel has proper handling
if (!isNextDeploy) {
it('should omit internal headers for middleware cookies', async () => {
const response = await next.fetch('/rsc-cookies/cookie-options')
expect(response.status).toBe(200)
expect(response.headers.get('x-middleware-set-cookie')).toBeNull()
})
it('should omit internal headers for middleware cookies', async () => {
const response = await next.fetch('/rsc-cookies/cookie-options')
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 () => {
const $ = await next.render$(
'/cookies',
{},
{
headers: {
'x-middleware-set-cookie': 'test',
},
}
)
it('should ignore x-middleware-set-cookie as a request header', async () => {
const $ = await next.render$(
'/cookies',
{},
{
headers: {
'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 () => {
const browser = await next.browser('/rsc-cookies')
Expand Down

0 comments on commit ef41607

Please sign in to comment.