diff options
Diffstat (limited to 'frontend-vanilla/src/main.test.ts')
| -rw-r--r-- | frontend-vanilla/src/main.test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend-vanilla/src/main.test.ts b/frontend-vanilla/src/main.test.ts index c9d0e0c..3798f1b 100644 --- a/frontend-vanilla/src/main.test.ts +++ b/frontend-vanilla/src/main.test.ts @@ -65,10 +65,19 @@ describe('main application logic', () => { it('renderLayout should create sidebar and main content', () => { renderLayout(); expect(document.getElementById('sidebar')).not.toBeNull(); + expect(document.querySelector('.logo')).not.toBeNull(); expect(document.getElementById('content-area')).not.toBeNull(); expect(document.getElementById('sidebar-toggle-btn')).not.toBeNull(); }); + it('should navigate to home when clicking logo', () => { + renderLayout(); + const logo = document.querySelector('.logo') as HTMLElement; + const navigateSpy = vi.spyOn(router, 'navigate'); + logo.click(); + expect(navigateSpy).toHaveBeenCalledWith('/', expect.any(Object)); + }); + it('renderFeeds should populate feed list', () => { renderLayout(); store.setFeeds([{ _id: 1, title: 'Test Feed', url: 'test', web_url: 'test', category: 'tag' }]); |
