@@ -457,20 +457,20 @@ test.describe("actions", () => {
457
457
"/qwikcity-test/issue7732/c/?redirected=true" ,
458
458
) ;
459
459
} ) ;
460
- // TODO: Fix this test (currently not working because the action redirect adds a `/q-data.json` at the end of the path)
461
- test . fixme (
462
- "action with redirect without query params in a route with query param should redirect to route without query params" ,
463
- async ( { page } ) => {
464
- await page . goto (
465
- "/qwikcity-test/action-redirect-without-search-params/?test=test" ,
466
- ) ;
467
- const button = page . locator ( "button" ) ;
468
- await button . click ( ) ;
469
- await page . waitForURL (
470
- "/qwikcity-test/action-redirect-without-search-params-target/" ,
471
- ) ;
472
- } ,
473
- ) ;
460
+ test ( "action with redirect without query params in a route with query param should redirect to route without query params" , async ( {
461
+ page ,
462
+ } ) => {
463
+ await page . goto (
464
+ "/qwikcity-test/action-redirect-without-search-params/?test=test" ,
465
+ ) ;
466
+ const button = page . locator ( "button" ) ;
467
+ await button . click ( ) ;
468
+ await page . waitForURL (
469
+ "/qwikcity-test/action-redirect-without-search-params-target/" ,
470
+ ) ;
471
+ const searchParams = new URL ( page . url ( ) ) . searchParams ;
472
+ expect ( searchParams . size ) . toBe ( 0 ) ;
473
+ } ) ;
474
474
test ( "media in home page" , async ( { page } ) => {
475
475
await page . goto ( "/qwikcity-test/" ) ;
476
476
@@ -521,6 +521,22 @@ test.describe("actions", () => {
521
521
522
522
await expect ( page . locator ( "#redirected-result" ) ) . toHaveText ( "true" ) ;
523
523
} ) ;
524
+
525
+ test . only ( "server plugin q-data redirect from /redirectme to /" , async ( {
526
+ baseURL,
527
+ } ) => {
528
+ const res = await fetch (
529
+ new URL ( "/qwikcity-test/redirectme/q-data.json" , baseURL ) ,
530
+ {
531
+ redirect : "manual" ,
532
+ headers : {
533
+ Accept : "application/json" ,
534
+ } ,
535
+ } ,
536
+ ) ;
537
+ expect ( res . status ) . toBe ( 301 ) ;
538
+ expect ( res . headers . get ( "Location" ) ) . toBe ( "/qwikcity-test/q-data.json" ) ;
539
+ } ) ;
524
540
}
525
541
} ) ;
526
542
0 commit comments