File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
test/integration/prerender Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ const Page = ({ world, time }) => {
2929 < Link href = "/blog/[post]" as = "/blog/post-1" >
3030 < a id = "post-1" > to dynamic</ a >
3131 </ Link >
32+ < Link href = "/blog/[post]" as = "/blog/post-100" >
33+ < a id = "broken-post" > to broken</ a >
34+ </ Link >
3235 < br />
3336 < Link href = "/blog/[post]/[comment]" as = "/blog/post-1/comment-1" >
3437 < a id = "comment-1" > to another dynamic</ a >
Original file line number Diff line number Diff line change @@ -261,6 +261,15 @@ const runTests = (dev = false) => {
261261 expect ( text ) . toMatch ( / p o s t .* ?p o s t - 1 / )
262262 } )
263263
264+ it ( 'should reload page on failed data request' , async ( ) => {
265+ const browser = await webdriver ( appPort , '/' )
266+ await waitFor ( 500 )
267+ await browser . eval ( 'window.beforeClick = true' )
268+ await browser . click ( '#broken-post' )
269+ await waitFor ( 1000 )
270+ expect ( await browser . eval ( 'window.beforeClick' ) ) . not . toBe ( 'true' )
271+ } )
272+
264273 if ( dev ) {
265274 it ( 'should always call getStaticProps without caching in dev' , async ( ) => {
266275 const initialRes = await fetchViaHTTP ( appPort , '/something' )
You can’t perform that action at this time.
0 commit comments