fix card layout

This commit is contained in:
2026-06-08 16:59:30 +02:00
parent 0ee9e22109
commit 83fdb464af
2 changed files with 24 additions and 29 deletions
@@ -100,7 +100,7 @@ describe('RssFeeds', () => {
expect(wrapper.find('.article').classes()).toContain('article--cards')
})
it('lets a card grow to fit the full article once its readable content has loaded', async () => {
it('shows the full article content in cards with no truncation, growing the card to fit', async () => {
axios.get.mockResolvedValueOnce({
data: {
feeds: [
@@ -110,7 +110,7 @@ describe('RssFeeds', () => {
{
id: 1,
title: 'Article one',
content: '<p>short summary</p>',
content: '<img src="https://example.test/photo.jpg" alt="photo"><br>short summary',
url: 'https://example.test/1',
timestamp: '2026-01-01',
},
@@ -127,14 +127,15 @@ describe('RssFeeds', () => {
const wrapper = mount(RssFeeds)
await flushPromises()
// Clamped to a fixed number of lines while only the short summary is shown...
expect(wrapper.find('.feed-content').classes()).toContain('feed-content--clamped')
// Preview images are shown (not hidden/truncated) and the snippet isn't clamped.
expect(wrapper.find('.feed-content img').exists()).toBe(true)
expect(wrapper.find('.feed-content').classes()).not.toContain('feed-content--clamped')
expect(wrapper.text()).toContain('short summary')
await wrapper.find('.feed-title').trigger('click')
await flushPromises()
// ...but allowed to grow once the user has loaded the full readable article.
expect(wrapper.find('.feed-content').classes()).not.toContain('feed-content--clamped')
expect(wrapper.text()).toContain('full text')
})
it('sorts articles by date across feeds, newest first', async () => {