From 0a73f51ed9c29fe57446ac47bb033c04179fd64b Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Wed, 2 Aug 2017 17:28:23 +0200 Subject: [PATCH] updated tests to latest changes in authkey system --- web/client/libs/__tests__/ajax-test.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/web/client/libs/__tests__/ajax-test.js b/web/client/libs/__tests__/ajax-test.js index b5cb5d5fb0..6d61245249 100644 --- a/web/client/libs/__tests__/ajax-test.js +++ b/web/client/libs/__tests__/ajax-test.js @@ -50,10 +50,8 @@ const authenticationRules = [ }, { "urlPattern": ".*youhavetouseacustomone.*", - "method": { - "method": "authkey-param", - "param": "mario" - } + "authkeyParamName": "mario", + "method": "authkey" }, { "urlPattern": ".*thisismissingtheparam.*", @@ -268,20 +266,6 @@ describe('Tests ajax library', () => { }); }); - it('falls back to standard authkey if the custom one is misconfigured', (done) => { - // mocking the authentication rules and user info - expect.spyOn(SecurityUtils, 'isAuthenticationActivated').andReturn(true); - expect.spyOn(SecurityUtils, 'getAuthenticationRules').andReturn(authenticationRules); - expect.spyOn(SecurityUtils, 'getSecurityInfo').andReturn(securityInfoB); - const theExpectedString = 'authkey%3D' + securityInfoB.token; - axios.get('http://non-existent.mapstore2/thisismissingtheparam?parameter1=value1&par2=v2').then(() => { - done("Axios actually reached the fake url"); - }).catch((exception) => { - expect(exception.config).toExist().toIncludeKey('url'); - expect(exception.config.url.indexOf(theExpectedString)).toBeGreaterThan(-1); - done(); - }); - }); it('does not add autkeys if the configuration is wrong', (done) => { // mocking the authentication rules and user info