From e5940ff785ae79fb93f80c8ca64546e5e0852c8f Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 31 Dec 2024 18:14:01 +0100 Subject: [PATCH] revert: refs #7058 component changes --- src/components/__tests__/Leftmenu.spec.js | 46 +---------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/src/components/__tests__/Leftmenu.spec.js b/src/components/__tests__/Leftmenu.spec.js index 17d7cf56c..f38aec567 100644 --- a/src/components/__tests__/Leftmenu.spec.js +++ b/src/components/__tests__/Leftmenu.spec.js @@ -132,55 +132,13 @@ function mount(source) { return wrapper; } -describe.only('getRoutes', () => { - beforeEach(() => {}); - // afterEach(() => vi.clearAllMocks()); - // const getRoutes = vi - // .fn() - // .mockImplementation((props, getMainRoutes, getCardRoutes) => { - // const handleRoutes = { - // main: getMainRoutes, - // card: getCardRoutes, - // }; - // console.log(props.source); - // handleRoutes[props.source](); - // }); - - // const getMainRoutes = vi.fn(); - // const getCardRoutes = vi.fn(); - it('should call getCardRoutes when source is card', () => { - vm = mount('card').vm; - let props = { source: 'card' }; - vi.spyOn(vm, 'getCardRoutes'); - vm.getRoutes(); - // getRoutes(props, getMainRoutes, getCardRoutes); - - expect(vm.getCardRoutes).toHaveBeenCalled(); - // expect(vm.getMainRoutes).not.toHaveBeenCalled(); - }); - // it.skip('should call getMainRoutes when source is main', () => { - // let props = { source: 'main' }; - - // getRoutes(props, getMainRoutes, getCardRoutes); - - // expect(getMainRoutes).toHaveBeenCalled(); - // expect(getCardRoutes).not.toHaveBeenCalled(); - // }); -}); -describe.skip('Leftmenu as card', () => { +describe('Leftmenu as card', () => { beforeAll(() => { - vm = mount('main').vm; - vi.spyOn(vm, 'getCardRoutes'); - vi.spyOn(vm, 'getMainRoutes'); - vm.getCardRoutes = vi.fn().mockReturnValue(vi.fn); - }); - beforeEach(() => { - vm.getMainRoutes = vi.fn(); + vm = mount('card').vm; }); it('should get routes for card source', async () => { vm.getRoutes(); - expect(vm.getMainRoutes).toHaveBeenCalled(); }); }); describe('Leftmenu as main', () => {