Skip to content

Commit

Permalink
test: added tests to check that the vary header contains 'RSC' (#1993)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed Mar 23, 2023
1 parent d4cd121 commit 124d4ae
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cypress/integration/default/appdir.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ describe('appDir', () => {
})
})

it('returns a vary header for RSC data requests to ISR pages', () => {
cy.request({
url: '/blog/erica/',
followRedirect: false,
headers: {
RSC: '1',
},
}).then((response) => {
expect(response.headers).to.have.property('vary').contains('RSC')
})
})

it('returns a vary header for non-RSC data requests to ISR pages', () => {
cy.request({
url: '/blog/erica/',
followRedirect: false,
}).then((response) => {
expect(response.headers).to.have.property('vary').contains('RSC')
})
})

it('returns RSC data for RSC requests to static pages', () => {
cy.request({
url: '/blog/erica/first-post/',
Expand Down

0 comments on commit 124d4ae

Please sign in to comment.