#7058 LeftMenu vitest #1153
|
@ -93,4 +93,23 @@ describe('LeftMenu', () => {
|
|||
vm.getRoutes();
|
||||
expect(useNavigationStore().getModules).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should compute pinnedModules correctly', () => {
|
||||
vm.items = [
|
||||
{ name: 'Item 1', isPinned: false },
|
||||
{ name: 'Item 2', isPinned: true },
|
||||
];
|
||||
expect(vm.pinnedModules).toEqual(
|
||||
new Map([['Item 2', { name: 'Item 2', isPinned: true }]])
|
||||
);
|
||||
});
|
||||
|
||||
it('should compute filteredItems correctly', () => {
|
||||
vm.items = [
|
||||
{ name: 'Item 1', isPinned: false },
|
||||
{ name: 'Item 2', isPinned: true },
|
||||
];
|
||||
vm.search = 'Item 1';
|
||||
expect(vm.filteredItems).toEqual([{ name: 'Item 1', isPinned: false }]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue