all caught up icon, counter dynamic

This commit is contained in:
2026-06-09 20:20:17 +02:00
parent b851e0257c
commit 039e0b448c
5 changed files with 53 additions and 6 deletions
@@ -161,6 +161,19 @@ describe('AppNav', () => {
expect(wrapper.find('.app-nav__title').text()).toContain('(2)')
})
it('excludes already-read articles from the counter while in article view', async () => {
const { feeds } = useFeeds()
feeds.value = [
{ id: 1, title: 'Article one', read: true, content: '', url: 'https://example.test/1', timestamp: '2026-01-01' },
{ id: 2, title: 'Article two', read: false, content: '', url: 'https://example.test/2', timestamp: '2026-01-02' },
]
const wrapper = mount(AppNav, { global: { plugins: [router] } })
await flushPromises()
expect(wrapper.find('.app-nav__title').text()).toContain('(1)')
})
it('hides the unread count when there are no articles', async () => {
const wrapper = mount(AppNav, { global: { plugins: [router] } })
await flushPromises()
@@ -40,7 +40,7 @@ describe('RssFeeds', () => {
await flushPromises()
expect(axios.get).toHaveBeenCalledWith('/api/v1/article/get/7', expect.anything())
expect(wrapper.text()).toContain('No unread articles.')
expect(wrapper.text()).toContain('All caught up')
})
it('renders the fetched feed items', async () => {
@@ -68,7 +68,7 @@ describe('RssFeeds', () => {
expect(wrapper.text()).toContain('Article one')
expect(wrapper.text()).toContain('My Feed')
expect(wrapper.text()).not.toContain('No unread articles.')
expect(wrapper.text()).not.toContain('All caught up')
})
it('renders the list as cards when the card layout is selected', async () => {