Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-enable middleware deploy tests #73744

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading