revert: refs #7058 component changes

This commit is contained in:
Javier Segarra 2024-12-31 18:14:01 +01:00
parent 3c5b8d4fbf
commit e5940ff785
1 changed files with 2 additions and 44 deletions

View File

@ -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', () => {