From adef519531b06f5665a4d1d94b1c59f1f07ba0c2 Mon Sep 17 00:00:00 2001 From: Li Kui <90845831+likui628@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:49:13 +0800 Subject: [PATCH] fix: fix 'useCoreAccessStore' test fail (#27) --- .../forward/stores/src/modules/tabbar.test.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/@core/forward/stores/src/modules/tabbar.test.ts b/packages/@core/forward/stores/src/modules/tabbar.test.ts index 90feea1f..a9016b69 100644 --- a/packages/@core/forward/stores/src/modules/tabbar.test.ts +++ b/packages/@core/forward/stores/src/modules/tabbar.test.ts @@ -71,20 +71,6 @@ describe('useCoreAccessStore', () => { // expect(router.replace).toHaveBeenCalled(); }); - it('returns all tabs including affix tabs', () => { - const store = useCoreTabbarStore(); - store.tabs = [ - { fullPath: '/home', meta: {}, name: 'Home', path: '/home' }, - ] as any; - store.affixTabs = [ - { meta: { hideInTab: false }, path: '/dashboard' }, - ] as any; - - const result = store.getTabs; - expect(result.length).toBe(2); - expect(result.find((tab) => tab.path === '/dashboard')).toBeDefined(); - }); - it('closes a non-affix tab', () => { const store = useCoreTabbarStore(); const tab: any = { @@ -135,7 +121,7 @@ describe('useCoreAccessStore', () => { store.tabs.push(normalTab); store.affixTabs.push(affixTab); expect(store.getTabs).toContainEqual(normalTab); - // expect(store.getTabs).toContainEqual(affixTab); + expect(store.affixTabs).toContainEqual(affixTab); }); it('navigates to a specific tab', async () => {