#7058 LeftMenu vitest #1153

Open
jsegarra wants to merge 18 commits from 7058_leftMenu_vitest into dev
1 changed files with 19 additions and 0 deletions
Showing only changes of commit 2bfc6606f0 - Show all commits

View File

@ -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 }]);
});
});