Skip to content

Commit

Permalink
Removed ClientRouter.getUrl implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
PS committed Jun 4, 2024
1 parent d459fd2 commit 27468dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 0 additions & 7 deletions packages/core/src/router/ClientRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ export class ClientRouter extends AbstractRouter {
return this;
}

/**
* @inheritDoc
*/
getUrl() {
return this._window.getUrl();
}

/**
* @inheritDoc
*/
Expand Down
10 changes: 6 additions & 4 deletions packages/core/src/router/__tests__/ClientRouterSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('ima.core.router.ClientRouter', () => {
30000
);

jest.spyOn(router, 'getPath').mockReturnValue('/routePath');
jest.spyOn(router, 'getPath').mockReturnValue('/routePath?foo=bar');

router.init(routerConfig);
});
Expand All @@ -50,11 +50,13 @@ describe('ima.core.router.ClientRouter', () => {
});

it('should be return actual url', () => {
jest.spyOn(window, 'getUrl').mockImplementation();
jest.spyOn(router, 'getBaseUrl');
jest.spyOn(router, 'getPath');

router.getUrl();
expect(router.getUrl()).toBe('http://locahlost:3002/routePath?foo=bar');

expect(window.getUrl).toHaveBeenCalled();
expect(router.getBaseUrl).toHaveBeenCalled();
expect(router.getPath).toHaveBeenCalled();
});

it('should add listener to popState event, click event', () => {
Expand Down

0 comments on commit 27468dc

Please sign in to comment.