#7058 LeftMenu vitest #1153
|
@ -133,7 +133,33 @@ describe('Leftmenu as main', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
vm = mount('main').vm;
|
vm = mount('main').vm;
|
||||||
});
|
});
|
||||||
|
// WIP
|
||||||
|
it.skip('should call getMainRoutes when source is main', () => {
|
||||||
|
vm.getRoutes = vi
|
||||||
|
.fn()
|
||||||
|
.mockImplementation((props, getMainRoutes, getCardRoutes) => {
|
||||||
|
const handleRoutes = {
|
||||||
|
main: getMainRoutes,
|
||||||
|
card: getCardRoutes,
|
||||||
|
};
|
||||||
|
console.log(props.source);
|
||||||
|
handleRoutes[props.source]();
|
||||||
|
});
|
||||||
|
let props = { source: 'main' };
|
||||||
|
const getMainRoutes = vi.fn();
|
||||||
|
const getCardRoutes = vi.fn();
|
||||||
|
|
||||||
|
vm.getRoutes(props, getMainRoutes, getCardRoutes);
|
||||||
|
|
||||||
|
expect(getMainRoutes).toHaveBeenCalled();
|
||||||
|
expect(getCardRoutes).not.toHaveBeenCalled();
|
||||||
|
props = { source: 'card' };
|
||||||
|
|
||||||
|
vm.getRoutes(props, getMainRoutes, getCardRoutes);
|
||||||
|
|
||||||
|
expect(getCardRoutes).toHaveBeenCalled();
|
||||||
|
expect(getMainRoutes).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
it('should return a proper formated object with two child items', async () => {
|
it('should return a proper formated object with two child items', async () => {
|
||||||
const expectedMenuItem = [
|
const expectedMenuItem = [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue