@@ -750,35 +750,16 @@ describe("i18n-specific behavior", () => {
750750 cy . get ( "h1" ) . should ( "contain" , "Show #5" ) ;
751751 } ) ;
752752
753- it ( "does render an included path for fallback routes with non-default locale defined" , ( ) => {
753+ it ( "renders an included path for fallback routes with non-default locale defined" , ( ) => {
754754 cy . visit ( "/fr/getStaticProps/withFallback/4" ) ;
755755
756756 cy . get ( "h1" ) . should ( "contain" , "Show #4" ) ;
757757 } ) ;
758758
759- it ( "does not render an included path for fallback routes with non-default locale" , ( ) => {
760- // because the locale needs to be included in the paths provided to getStaticPaths
761- cy . request ( {
762- url : "/fr/getStaticProps/withFallback/3" ,
763- failOnStatusCode : false ,
764- } ) . then ( ( response ) => {
765- expect ( response . status ) . to . eq ( 404 ) ;
766- cy . state ( "document" ) . write ( response . body ) ;
767- } ) ;
768-
769- cy . get ( "h2" ) . should ( "contain" , "This page could not be found." ) ;
770- } ) ;
759+ it ( "renders non-included path for fallback routes with non-default locale" , ( ) => {
760+ cy . visit ( "/fr/getStaticProps/withFallback/71" ) ;
771761
772- it ( "does not render a not-included path for fallback routes with non-default locale" , ( ) => {
773- cy . request ( {
774- url : "/fr/getStaticProps/withFallback/5" ,
775- failOnStatusCode : false ,
776- } ) . then ( ( response ) => {
777- expect ( response . status ) . to . eq ( 404 ) ;
778- cy . state ( "document" ) . write ( response . body ) ;
779- } ) ;
780-
781- cy . get ( "h2" ) . should ( "contain" , "This page could not be found." ) ;
762+ cy . get ( "h1" ) . should ( "contain" , "Show #71" ) ;
782763 } ) ;
783764
784765 it ( "renders non-default locale path for revalidate page" , ( ) => {
@@ -803,13 +784,13 @@ describe("i18n-specific behavior", () => {
803784 } ) ;
804785
805786 context ( "SSR'd pages" , ( ) => {
806- it ( "renders non-default locale for SSR'd non-dynamic route" , ( ) => {
787+ it ( "renders non-default locale for non-dynamic route" , ( ) => {
807788 cy . visit ( "/fr/getServerSideProps/static" ) ;
808789
809790 cy . get ( "h1" ) . should ( "contain" , "Show #42" ) ;
810791 } ) ;
811792
812- it ( "renders non-default locale for SSR'd dynamic route" , ( ) => {
793+ it ( "renders non-default locale for dynamic route" , ( ) => {
813794 cy . visit ( "/fr/getServerSideProps/5" ) ;
814795
815796 cy . get ( "h1" ) . should ( "contain" , "Show #5" ) ;
@@ -821,4 +802,30 @@ describe("i18n-specific behavior", () => {
821802 cy . get ( "h1" ) . should ( "contain" , "Show #5" ) ;
822803 } ) ;
823804 } ) ;
805+
806+ context ( "getInitialProps pages" , ( ) => {
807+ it ( "renders naked route" , ( ) => {
808+ cy . visit ( "/shows/42" ) ;
809+
810+ cy . get ( "h1" ) . should ( "contain" , "Show #42" ) ;
811+ } ) ;
812+
813+ it ( "renders non-default locale" , ( ) => {
814+ cy . visit ( "/fr/shows/42" ) ;
815+
816+ cy . get ( "h1" ) . should ( "contain" , "Show #42" ) ;
817+ } ) ;
818+ } ) ;
819+
820+ context ( "withoutProps pages" , ( ) => {
821+ it ( "renders default locale" , ( ) => {
822+ cy . visit ( "/en/static" ) ;
823+ cy . get ( "p" ) . should ( "contain" , "It is a static page." ) ;
824+ } ) ;
825+
826+ it ( "renders non-default locale" , ( ) => {
827+ cy . visit ( "/fr/static" ) ;
828+ cy . get ( "p" ) . should ( "contain" , "It is a static page." ) ;
829+ } ) ;
830+ } ) ;
824831} ) ;
0 commit comments