diff --git a/vue/src/components/RssFeeds.vue b/vue/src/components/RssFeeds.vue index c379279..7af7ff2 100644 --- a/vue/src/components/RssFeeds.vue +++ b/vue/src/components/RssFeeds.vue @@ -107,7 +107,7 @@ onMounted(async () => {

{{ feed.feedTitle }}

{{ feed.title }}

{{ feed.timestamp }}

- diff --git a/vue/src/components/__tests__/RssFeeds.spec.js b/vue/src/components/__tests__/RssFeeds.spec.js index 3d4c168..11c8a07 100644 --- a/vue/src/components/__tests__/RssFeeds.spec.js +++ b/vue/src/components/__tests__/RssFeeds.spec.js @@ -184,10 +184,7 @@ describe('RssFeeds', () => { expect(titles).toEqual(['Newer article', 'Older article']) }) - it('shows a link to the original article until the readable version is loaded', async () => { - // The API returns each item with a short summary already in `content` — - // the link must key off the `readable` flag (set once Readability has - // parsed the full article), not off `content` truthiness. + it('keeps a link to the original article visible after the readable version is loaded', async () => { axios.get.mockResolvedValueOnce({ data: { feeds: [ @@ -226,7 +223,9 @@ describe('RssFeeds', () => { await wrapper.find('.feed-title').trigger('click') await flushPromises() - expect(wrapper.find('.feed-original-link a').exists()).toBe(false) + const linkAfter = wrapper.find('.feed-original-link a') + expect(linkAfter.exists()).toBe(true) + expect(linkAfter.attributes('href')).toBe('https://example.test/1') }) it('switches to article view and navigates between articles', async () => { @@ -277,7 +276,7 @@ describe('RssFeeds', () => { await flushPromises() expect(axios.post).toHaveBeenCalledWith('/api/v1/article/read', { url: 'https://example.test/1' }, expect.anything()) - expect(wrapper.find('.article-single .feed-original-link a').exists()).toBe(false) + expect(wrapper.find('.article-single .feed-original-link a').exists()).toBe(true) expect(wrapper.findAll('.article-nav__btn')[0].attributes('disabled')).toBeDefined()