@@ -59,6 +59,30 @@ describe('astro:i18n virtual module', () => {
59
59
} ) ;
60
60
} ) ;
61
61
describe ( '[DEV] i18n routing' , ( ) => {
62
+ describe ( 'should render a page that stars with a locale but it is a page' , ( ) => {
63
+ /** @type {import('./test-utils').Fixture } */
64
+ let fixture ;
65
+ /** @type {import('./test-utils').DevServer } */
66
+ let devServer ;
67
+
68
+ before ( async ( ) => {
69
+ fixture = await loadFixture ( {
70
+ root : './fixtures/i18n-routing/' ,
71
+ } ) ;
72
+ devServer = await fixture . startDevServer ( ) ;
73
+ } ) ;
74
+
75
+ after ( async ( ) => {
76
+ await devServer . stop ( ) ;
77
+ } ) ;
78
+
79
+ it ( 'renders the page' , async ( ) => {
80
+ const response = await fixture . fetch ( '/endurance' ) ;
81
+ expect ( response . status ) . to . equal ( 200 ) ;
82
+ expect ( await response . text ( ) ) . includes ( 'Endurance' ) ;
83
+ } ) ;
84
+ } ) ;
85
+
62
86
describe ( 'i18n routing' , ( ) => {
63
87
/** @type {import('./test-utils').Fixture } */
64
88
let fixture ;
@@ -1005,6 +1029,23 @@ describe('[SSG] i18n routing', () => {
1005
1029
} ) ;
1006
1030
} ) ;
1007
1031
1032
+ describe ( 'should render a page that stars with a locale but it is a page' , ( ) => {
1033
+ /** @type {import('./test-utils').Fixture } */
1034
+ let fixture ;
1035
+
1036
+ before ( async ( ) => {
1037
+ fixture = await loadFixture ( {
1038
+ root : './fixtures/i18n-routing/' ,
1039
+ } ) ;
1040
+ await fixture . build ( ) ;
1041
+ } ) ;
1042
+
1043
+ it ( 'renders the page' , async ( ) => {
1044
+ const html = await fixture . readFile ( '/endurance/index.html' ) ;
1045
+ expect ( html ) . includes ( 'Endurance' ) ;
1046
+ } ) ;
1047
+ } ) ;
1048
+
1008
1049
describe ( 'current locale' , ( ) => {
1009
1050
describe ( 'with [prefix-other-locales]' , ( ) => {
1010
1051
/** @type {import('./test-utils').Fixture } */
@@ -1068,6 +1109,29 @@ describe('[SSG] i18n routing', () => {
1068
1109
} ) ;
1069
1110
describe ( '[SSR] i18n routing' , ( ) => {
1070
1111
let app ;
1112
+
1113
+ describe ( 'should render a page that stars with a locale but it is a page' , ( ) => {
1114
+ /** @type {import('./test-utils').Fixture } */
1115
+ let fixture ;
1116
+
1117
+ before ( async ( ) => {
1118
+ fixture = await loadFixture ( {
1119
+ root : './fixtures/i18n-routing/' ,
1120
+ output : 'server' ,
1121
+ adapter : testAdapter ( ) ,
1122
+ } ) ;
1123
+ await fixture . build ( ) ;
1124
+ app = await fixture . loadTestAdapterApp ( ) ;
1125
+ } ) ;
1126
+
1127
+ it ( 'renders the page' , async ( ) => {
1128
+ let request = new Request ( 'http://example.com/endurance' ) ;
1129
+ let response = await app . render ( request ) ;
1130
+ expect ( response . status ) . to . equal ( 200 ) ;
1131
+ expect ( await response . text ( ) ) . includes ( 'Endurance' ) ;
1132
+ } ) ;
1133
+ } ) ;
1134
+
1071
1135
describe ( 'default' , ( ) => {
1072
1136
/** @type {import('./test-utils').Fixture } */
1073
1137
let fixture ;
0 commit comments