Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed May 25, 2021
1 parent e35d5c8 commit 8b6e441
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getSpaceUrlPrefix } from '../../../common/lib/authentication/spaces';
// eslint-disable-next-line import/no-default-export
export default ({ getService }: FtrProviderContext) => {
const supertestWithoutAuth = getService('supertestWithoutAuth');
const supertest = getService('supertest');
const TEST_URL = '/security-myfakepath';
const SPACE1 = 'space1';
const SPACE2 = 'space2';
Expand Down Expand Up @@ -104,5 +105,23 @@ export default ({ getService }: FtrProviderContext) => {
});
}
});

describe('extra params', () => {
it('should NOT allow to pass a filter query parameter', async () => {
await supertest
.get(`${getSpaceUrlPrefix(SPACE1)}${TEST_URL}?sortOrder=asc&namespaces[0]=*`)
.set('kbn-xsrf', 'true')
.send()
.expect(400);
});

it('should NOT allow to pass a non supported query parameter', async () => {
await supertest
.get(`${getSpaceUrlPrefix(SPACE1)}${TEST_URL}?notExists=something`)
.set('kbn-xsrf', 'true')
.send()
.expect(400);
});
});
});
};

0 comments on commit 8b6e441

Please sign in to comment.