revert: refs #7058 component changes
This commit is contained in:
parent
3c5b8d4fbf
commit
e5940ff785
|
@ -132,55 +132,13 @@ function mount(source) {
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
describe.only('getRoutes', () => {
|
describe('Leftmenu as card', () => {
|
||||||
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', () => {
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
vm = mount('main').vm;
|
vm = mount('card').vm;
|
||||||
vi.spyOn(vm, 'getCardRoutes');
|
|
||||||
vi.spyOn(vm, 'getMainRoutes');
|
|
||||||
vm.getCardRoutes = vi.fn().mockReturnValue(vi.fn);
|
|
||||||
});
|
|
||||||
beforeEach(() => {
|
|
||||||
vm.getMainRoutes = vi.fn();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get routes for card source', async () => {
|
it('should get routes for card source', async () => {
|
||||||
vm.getRoutes();
|
vm.getRoutes();
|
||||||
expect(vm.getMainRoutes).toHaveBeenCalled();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('Leftmenu as main', () => {
|
describe('Leftmenu as main', () => {
|
||||||
|
|
Loading…
Reference in New Issue