@@ -80,18 +80,16 @@ test.describe('base path', () => {
8080
8181 test ( 'fetch outside base path succeeds' , async ( { page, baseURL } ) => {
8282 await page . goto ( '/path-base/fetch/link-outside-base/' ) ;
83- expect ( await page . locator ( '[data-testid="fetch-url"]' ) . textContent ( ) ) . toContain (
84- `${ baseURL } /not-base-path/`
85- ) ;
86- expect ( await page . locator ( '[data-testid="fetch-response"]' ) . textContent ( ) ) . toContain (
83+ await expect ( page . locator ( '[data-testid="fetch-url"]' ) ) . toHaveText ( `${ baseURL } /not-base-path/` ) ;
84+ await expect ( page . locator ( '[data-testid="fetch-response"]' ) ) . toContainText (
8785 'did you mean to visit'
8886 ) ;
8987 } ) ;
9088
9189 test ( 'fetch to root succeeds' , async ( { page, baseURL } ) => {
9290 await page . goto ( '/path-base/fetch/link-root/' ) ;
9391 // fetch to root with trailing slash
94- expect ( await page . locator ( '[data-testid="fetch1-url"]' ) . textContent ( ) ) . toContain ( `${ baseURL } /` ) ;
92+ await expect ( page . locator ( '[data-testid="fetch1-url"]' ) ) . toHaveText ( `${ baseURL } /` ) ;
9593 const fetch1Response = await page . locator ( '[data-testid="fetch1-response"]' ) . textContent ( ) ;
9694 const fetch1Redirect = await page . locator ( '[data-testid="fetch1-redirect"]' ) . textContent ( ) ;
9795 expect (
@@ -102,16 +100,8 @@ test.describe('base path', () => {
102100 ) . toBe ( true ) ;
103101
104102 // fetch to root without trailing slash should be relative
105- expect ( await page . locator ( '[data-testid="fetch2-url"]' ) . textContent ( ) ) . toBeFalsy ( ) ;
106- expect ( await page . locator ( '[data-testid="fetch2-response"]' ) . textContent ( ) ) . toBe ( 'relative' ) ;
107-
108- // fetch to root with custom base path with trailing slash
109- expect ( await page . locator ( '[data-testid="fetch3-url"]' ) . textContent ( ) ) . toBeFalsy ( ) ;
110- expect ( await page . locator ( '[data-testid="fetch3-response"]' ) . textContent ( ) ) . toBe ( 'root' ) ;
111-
112- // fetch to root with custom base path without trailing slash
113- expect ( await page . locator ( '[data-testid="fetch4-url"]' ) . textContent ( ) ) . toBeFalsy ( ) ;
114- expect ( await page . locator ( '[data-testid="fetch4-redirect"]' ) . textContent ( ) ) . toBe ( '/path-base/' ) ;
103+ await expect ( page . locator ( '[data-testid="fetch2-url"]' ) ) . toBeEmpty ( ) ;
104+ await expect ( page . locator ( '[data-testid="fetch2-response"]' ) ) . toHaveText ( 'relative' ) ;
115105 } ) ;
116106} ) ;
117107
0 commit comments