File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,14 @@ test("the application's noop index page is visible and it allows navigating to t
9
9
await expect ( page . getByText ( "Hello World!" ) ) . toBeVisible ( ) ;
10
10
} ) ;
11
11
12
- test ( "the hello-world api route works as intended" , async ( { page } ) => {
12
+ test ( "the hello-world api GET route works as intended" , async ( { page } ) => {
13
13
const res = await page . request . get ( "/api/hello" ) ;
14
14
expect ( res . headers ( ) [ "content-type" ] ) . toContain ( "text/plain" ) ;
15
15
expect ( await res . text ( ) ) . toEqual ( "Hello World!" ) ;
16
16
} ) ;
17
+
18
+ test ( "the hello-world api POST route works as intended" , async ( { page } ) => {
19
+ const res = await page . request . post ( "/api/hello" , { data : "some body" } ) ;
20
+ expect ( res . headers ( ) [ "content-type" ] ) . toContain ( "text/plain" ) ;
21
+ await expect ( res . text ( ) ) . resolves . toEqual ( "Hello post-World! body=some body" ) ;
22
+ } ) ;
You can’t perform that action at this time.
0 commit comments