Skip to content

Commit 4f2e4ac

Browse files
fix travis tests
1 parent 5dc1d1a commit 4f2e4ac

2 files changed

Lines changed: 20 additions & 22 deletions

File tree

web/client/libs/__tests__/ajax-test.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -359,31 +359,29 @@ describe('Tests ajax library', () => {
359359
});
360360

361361
it('does set withCredentials on the request', (done)=> {
362-
expect.spyOn(SecurityUtils, 'isAuthenticationActivated').andReturn(true);
363-
expect.spyOn(SecurityUtils, 'getAuthenticationRules').andReturn(authenticationRules);
362+
expect.spyOn(SecurityUtils, 'isAuthenticationActivated').andReturn(true);
363+
expect.spyOn(SecurityUtils, 'getAuthenticationRules').andReturn(authenticationRules);
364364

365-
axios.get('http://www.useBrowserCredentials.com/useBrowserCredentials?parameter1=value1&parameter2=value2').then(() => {
366-
done();
367-
}).catch( (exception) => {
368-
console.log(exception.config);
369-
expect(exception.config).toExist();
370-
expect(exception.config.withCredentials).toExist();
371-
expect(exception.config.withCredentials).toBeTruthy();
372-
done();
373-
});
365+
axios.get('http://www.useBrowserCredentials.com/useBrowserCredentials?parameter1=value1&parameter2=value2').then(() => {
366+
done();
367+
}).catch( (exception) => {
368+
expect(exception.config).toExist();
369+
expect(exception.config.withCredentials).toExist();
370+
expect(exception.config.withCredentials).toBeTruthy();
371+
done();
372+
});
374373
});
375374

376375
it('does not set withCredentials on the request', (done)=> {
377-
expect.spyOn(SecurityUtils, 'isAuthenticationActivated').andReturn(true);
378-
expect.spyOn(SecurityUtils, 'getAuthenticationRules').andReturn(authenticationRules);
376+
expect.spyOn(SecurityUtils, 'isAuthenticationActivated').andReturn(true);
377+
expect.spyOn(SecurityUtils, 'getAuthenticationRules').andReturn(authenticationRules);
379378

380-
axios.get('http://www.skipBrowserCredentials.com/geoserver?parameter1=value1&parameter2=value2').then(() => {
381-
done();
382-
}).catch( (exception) => {
383-
console.log(exception.config);
384-
expect(exception.config).toExist();
385-
expect(exception.config.withCredentials).toNotExist();
386-
done();
387-
});
379+
axios.get('http://www.skipBrowserCredentials.com/geoserver?parameter1=value1&parameter2=value2').then(() => {
380+
done();
381+
}).catch( (exception) => {
382+
expect(exception.config).toExist();
383+
expect(exception.config.withCredentials).toNotExist();
384+
done();
385+
});
388386
});
389387
});

web/client/libs/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function addAuthenticationToAxios(axiosConfig) {
4444
switch (rule && rule.method) {
4545
case 'browserWithCredentials':
4646
{
47-
axiosConfig.withCredentials=true;
47+
axiosConfig.withCredentials = true;
4848
return axiosConfig;
4949
}
5050
case 'authkey':

0 commit comments

Comments
 (0)