|
529 | 529 | }
|
530 | 530 | },
|
531 | 531 | {
|
532 |
| - "name": "7d. Successful Logout with Both Tokens", |
| 532 | + "name": "7d. Try Logout with Invalid JSON (Should Return JSON Error)", |
| 533 | + "event": [ |
| 534 | + { |
| 535 | + "listen": "test", |
| 536 | + "script": { |
| 537 | + "exec": [ |
| 538 | + "pm.test('Status code is 400', function() {", |
| 539 | + " pm.response.to.have.status(400);", |
| 540 | + "});", |
| 541 | + "", |
| 542 | + "pm.test('Response is JSON', function() {", |
| 543 | + " pm.response.to.be.json;", |
| 544 | + "});", |
| 545 | + "", |
| 546 | + "pm.test('Error message is correct', function() {", |
| 547 | + " var jsonData = pm.response.json();", |
| 548 | + " pm.expect(jsonData.error).to.include('400 Bad Request');", |
| 549 | + " pm.expect(jsonData.error).to.include('The browser (or proxy) sent a request that this server could not understand');", |
| 550 | + " pm.expect(jsonData.endpoint).to.equal('/auth/logout');", |
| 551 | + "});" |
| 552 | + ], |
| 553 | + "type": "text/javascript" |
| 554 | + } |
| 555 | + } |
| 556 | + ], |
| 557 | + "request": { |
| 558 | + "method": "POST", |
| 559 | + "header": [ |
| 560 | + { |
| 561 | + "key": "Content-Type", |
| 562 | + "value": "application/json", |
| 563 | + "type": "text" |
| 564 | + }, |
| 565 | + { |
| 566 | + "key": "Authorization", |
| 567 | + "value": "Bearer {{jwt_token}}", |
| 568 | + "type": "text" |
| 569 | + } |
| 570 | + ], |
| 571 | + "body": { |
| 572 | + "mode": "raw", |
| 573 | + "raw": "{ invalid json here" |
| 574 | + }, |
| 575 | + "url": { |
| 576 | + "raw": "http://localhost:8000/auth/logout", |
| 577 | + "protocol": "http", |
| 578 | + "host": ["localhost"], |
| 579 | + "port": "8000", |
| 580 | + "path": ["auth", "logout"] |
| 581 | + } |
| 582 | + } |
| 583 | + }, |
| 584 | + { |
| 585 | + "name": "7e. Successful Logout with Both Tokens", |
533 | 586 | "event": [
|
534 | 587 | {
|
535 | 588 | "listen": "test",
|
|
0 commit comments