Skip to content

Commit 01d3058

Browse files
committed
chore: update test comments
1 parent 30cdeb0 commit 01d3058

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cypress/e2e/default/dynamic-routes.cy.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ describe('Dynamic Routing', () => {
6161
expect(res.body).to.contain('Under the Dome')
6262
})
6363
})
64-
it('renders fallback page via ODB on a non-prerendered dynamic route with fallback: true', () => {
64+
it('does not render fallback page via ODB on a non-prerendered dynamic route with fallback: true', () => {
65+
// unfortunately there is a problem with `fallback: true` in ODB context - the fallback would be cached indefinitely
66+
// so visits to those pages would always render the fallback first and browser client would later re-render with correct
67+
// content. As this is not ideal the `fallback: true` is treated as `fallback: blocking`.
6568
cy.request({ url: '/getStaticProps/withFallback/3/', headers: { 'x-nf-debug-logging': '1' } }).then((res) => {
6669
expect(res.status).to.eq(200)
67-
// expect 'odb' until https://github.com/netlify/pillar-runtime/issues/438 is fixed
6870
expect(res.headers).to.have.property('x-nf-render-mode', 'odb')
69-
// expect 'Bitten' until the above is fixed and we can test for fallback 'Loading...' message
7071
expect(res.body).to.contain('Bitten')
7172
})
7273
})
@@ -115,12 +116,14 @@ describe('Dynamic Routing', () => {
115116
},
116117
)
117118
})
118-
it('renders fallback page via ODB on a non-prerendered dynamic route with revalidate and fallback: true', () => {
119+
it('does not render fallback page via ODB on a non-prerendered dynamic route with revalidate and fallback: true', () => {
120+
// unfortunately there is a problem with `fallback: true` in ODB context - the fallback would be cached indefinitely
121+
// so visits to those pages would always render the fallback first and browser client would later re-render with correct
122+
// content. As this is not ideal the `fallback: true` is treated as `fallback: blocking`.
119123
cy.request({ url: '/getStaticProps/withRevalidate/withFallback/3/', headers: { 'x-nf-debug-logging': '1' } }).then(
120124
(res) => {
121125
expect(res.status).to.eq(200)
122126
expect(res.headers).to.have.property('x-nf-render-mode', 'odb ttl=60')
123-
// expect 'Bitten' until https://github.com/netlify/pillar-runtime/issues/438 is fixed
124127
expect(res.body).to.contain('Bitten')
125128
},
126129
)

0 commit comments

Comments
 (0)