@@ -63,8 +63,8 @@ describe('Production Usage', () => {
63
63
afterAll ( ( ) => stopApp ( server ) )
64
64
65
65
it ( 'should contain generated page count in output' , async ( ) => {
66
- expect ( output ) . toContain ( 'Generating static pages (0/37 )' )
67
- expect ( output ) . toContain ( 'Generating static pages (37/37 )' )
66
+ expect ( output ) . toContain ( 'Generating static pages (0/38 )' )
67
+ expect ( output ) . toContain ( 'Generating static pages (38/38 )' )
68
68
// we should only have 4 segments and the initial message logged out
69
69
expect ( output . match ( / G e n e r a t i n g s t a t i c p a g e s / g) . length ) . toBe ( 5 )
70
70
} )
@@ -917,6 +917,55 @@ describe('Production Usage', () => {
917
917
expect ( await browser . eval ( 'window.location.pathname' ) ) . toBe ( '/non-existent' )
918
918
} )
919
919
920
+ it ( 'should remove placeholder for next/image correctly' , async ( ) => {
921
+ const browser = await webdriver ( context . appPort , '/' )
922
+
923
+ await browser . eval ( `(function() {
924
+ window.beforeNav = 1
925
+ window.next.router.push('/static-image')
926
+ })()` )
927
+ await browser . waitForElementByCss ( '#static-image' )
928
+
929
+ expect ( await browser . eval ( 'window.beforeNav' ) ) . toBe ( 1 )
930
+
931
+ await check (
932
+ ( ) => browser . elementByCss ( 'img' ) . getComputedCss ( 'background-image' ) ,
933
+ 'none'
934
+ )
935
+
936
+ await browser . eval ( `(function() {
937
+ window.beforeNav = 1
938
+ window.next.router.push('/')
939
+ })()` )
940
+ await browser . waitForElementByCss ( '.index-page' )
941
+ await waitFor ( 1000 )
942
+
943
+ await browser . eval ( `(function() {
944
+ window.beforeNav = 1
945
+ window.next.router.push('/static-image')
946
+ })()` )
947
+ await browser . waitForElementByCss ( '#static-image' )
948
+
949
+ expect ( await browser . eval ( 'window.beforeNav' ) ) . toBe ( 1 )
950
+
951
+ await check (
952
+ ( ) =>
953
+ browser
954
+ . elementByCss ( '#static-image' )
955
+ . getComputedCss ( 'background-image' ) ,
956
+ 'none'
957
+ )
958
+
959
+ for ( let i = 0 ; i < 5 ; i ++ ) {
960
+ expect (
961
+ await browser
962
+ . elementByCss ( '#static-image' )
963
+ . getComputedCss ( 'background-image' )
964
+ ) . toBe ( 'none' )
965
+ await waitFor ( 500 )
966
+ }
967
+ } )
968
+
920
969
dynamicImportTests ( context , ( p , q ) => renderViaHTTP ( context . appPort , p , q ) )
921
970
922
971
processEnv ( context )
0 commit comments