Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
  • Loading branch information
dguggemos committed Apr 28, 2021
1 parent 5e90ffb commit 02b336a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions javascript/lib/dom/tests/dom-auth.spec.ts
Expand Up @@ -132,7 +132,7 @@ describe('DomWebSocketBearerAuth', () => {
it('should add access_token parameter', () => {
const bearerAuth = DomWebSocketBearerAuth.newInstance(new DefaultTokenSupplier(exampleToken1));
const baseUrl = defaultUrl().toString();
const expected = `${baseUrl}?access_token=${exampleToken1}`;
const expected = `${baseUrl}&access_token=${exampleToken1}`;
const actual = bearerAuth.authenticateWithUrl(defaultUrl()).toString();

expect(actual).toEqual(expected);
Expand All @@ -152,14 +152,14 @@ describe('DomWebSocketBearerAuth', () => {
const bearerAuth = DomWebSocketBearerAuth.newInstance(testSupplier);

let authenticatedUrl = bearerAuth.authenticateWithUrl(defaultUrl());
expect(authenticatedUrl.queryParams.length).toEqual(1);
expect(authenticatedUrl.queryParams[0]).toEqual(`access_token=${exampleToken1}`);
expect(authenticatedUrl.queryParams.length).toEqual(2);
expect(authenticatedUrl.queryParams[1]).toEqual(`access_token=${exampleToken1}`);

testSupplier.testToken = exampleToken2;

authenticatedUrl = bearerAuth.authenticateWithUrl(defaultUrl());
expect(authenticatedUrl.queryParams.length).toEqual(1);
expect(authenticatedUrl.queryParams[0]).toEqual(`access_token=${exampleToken2}`);
expect(authenticatedUrl.queryParams.length).toEqual(2);
expect(authenticatedUrl.queryParams[1]).toEqual(`access_token=${exampleToken2}`);
});

});
Expand Down

0 comments on commit 02b336a

Please sign in to comment.