diff --git a/.changeset/cyan-cameras-beam.md b/.changeset/cyan-cameras-beam.md new file mode 100644 index 0000000000..4d5750b5bc --- /dev/null +++ b/.changeset/cyan-cameras-beam.md @@ -0,0 +1,5 @@ +--- +"@ima/core": patch +--- + +Removed ClientRouter.getUrl implementation diff --git a/packages/core/src/router/ClientRouter.ts b/packages/core/src/router/ClientRouter.ts index bce36f45aa..1676ca3301 100644 --- a/packages/core/src/router/ClientRouter.ts +++ b/packages/core/src/router/ClientRouter.ts @@ -106,13 +106,6 @@ export class ClientRouter extends AbstractRouter { return this; } - /** - * @inheritDoc - */ - getUrl() { - return this._window.getUrl(); - } - /** * @inheritDoc */ diff --git a/packages/core/src/router/__tests__/ClientRouterSpec.ts b/packages/core/src/router/__tests__/ClientRouterSpec.ts index c4adf814c4..b3a9d2502a 100644 --- a/packages/core/src/router/__tests__/ClientRouterSpec.ts +++ b/packages/core/src/router/__tests__/ClientRouterSpec.ts @@ -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); }); @@ -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', () => {