File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
repo/rest-api/tests/mocha/openapi-validation Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const { describeWithTestData } = require ( '../helpers/describeWithTestData' ) ;
4+ const {
5+ getItemEditRequests,
6+ getPropertyEditRequests,
7+ getItemCreateRequest
8+ } = require ( '../helpers/happyPathRequestBuilders' ) ;
9+ const { expect } = require ( '../helpers/chaiHelper' ) ;
10+ describeWithTestData ( '403 for all edit routes' , ( itemRequestInputs , propertyRequestInputs ) => {
11+ [
12+ ...getItemEditRequests ( itemRequestInputs ) ,
13+ ...getPropertyEditRequests ( propertyRequestInputs ) ,
14+ getItemCreateRequest ( itemRequestInputs )
15+ ] . forEach ( ( { newRequestBuilder } ) => {
16+ it ( `${ newRequestBuilder ( ) . getRouteDescription ( ) } responds with a valid 403 response` , async ( ) => {
17+ const response = await newRequestBuilder ( )
18+ . withJsonBodyParam ( 'bot' , true )
19+ . makeRequest ( ) ;
20+
21+ expect ( response ) . to . have . status ( 403 ) ;
22+ expect ( response ) . to . satisfyApiSpec ;
23+ } ) ;
24+ } ) ;
25+ } ) ;
You can’t perform that action at this time.
0 commit comments