diff --git a/cypress/integration/03-basic-timeline-spec.js b/cypress/integration/03-basic-timeline-spec.js index 214399a..b7e9265 100644 --- a/cypress/integration/03-basic-timeline-spec.js +++ b/cypress/integration/03-basic-timeline-spec.js @@ -8,6 +8,10 @@ describe('Basic timeline spec', () => { }) const homeTimeline = [ + {content: 'pinned toot 1'}, + {content: 'notification of unlisted message'}, + {content: 'notification of followers-only message'}, + {content: 'notification of direct message'}, {content: 'this is unlisted'}, {content: 'this is followers-only'}, {content: 'direct'}, @@ -25,23 +29,48 @@ describe('Basic timeline spec', () => { {content: 'hello world'} ].concat(times(30, i => ({content: (30 - i).toString()}))) - const localTimeline = homeTimeline.slice() - localTimeline.splice(0, 3) - localTimeline.splice(9, 2) + const localTimeline = [ + {spoiler: 'kitten CW'}, + {content: 'secret video'}, + {content: "here's a video"}, + {spoiler: 'CW'}, + {content: "here's a secret animated kitten gif"}, + {content: "here's an animated kitten gif"}, + {content: "here's 2 kitten photos"}, + {content: "here's a secret kitten"}, + {content: "here's a kitten"}, + {content: 'hello world'} + ].concat(times(30, i => ({content: (30 - i).toString()}))) const notifications = [ + {favoritedBy: 'admin'}, + {rebloggedBy: 'admin'}, + {content: 'notification of unlisted message'}, + {content: 'notification of followers-only message'}, + {content: 'notification of direct message'}, {followedBy: 'quux'}, {content: 'hello foobar'}, {followedBy: 'admin'} ] + const favorites = [ + {content: 'notification of direct message'}, + {content: 'notification of followers-only message'}, + {content: 'notification of unlisted message'}, + {content: 'pinned toot 1'} + ] + + const pinnedStatuses = [ + {content: 'this is unlisted'} + ] + it('Shows the home timeline', () => { cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-setsize') cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-posinset', '0') cy.validateTimeline(homeTimeline) - cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-setsize', (30 + 15).toString()) + cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-setsize', '49') }) it('Shows notifications', () => { @@ -49,7 +78,6 @@ describe('Basic timeline spec', () => { cy.url().should('contain', '/notifications') cy.validateTimeline(notifications) - }) it('Shows the local timeline', () => { @@ -67,4 +95,13 @@ describe('Basic timeline spec', () => { cy.validateTimeline(localTimeline) // local is same as federated in this case }) + + it('Shows favorites', () => { + cy.get('nav a[aria-label=Community]').click() + cy.url().should('contain', '/community') + cy.get('a').contains('Favorites').click() + cy.url().should('contain', '/favorites') + cy.validateTimeline(favorites) + }) + }) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5832380..a6eb129 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -65,6 +65,14 @@ Cypress.Commands.add('validateTimeline', (timeline) => { cy.getNthVirtualArticle(i).get('.status-header span').should('contain', status.followedBy) cy.getNthVirtualArticle(i).get('.status-header span').should('contain', 'followed you') } + if (status.rebloggedBy) { + cy.getNthVirtualArticle(i).get('.status-header span').should('contain', status.rebloggedBy) + cy.getNthVirtualArticle(i).get('.status-header span').should('contain', 'boosted') + } + if (status.favoritedBy) { + cy.getNthVirtualArticle(i).get('.status-header span').should('contain', status.favoritedBy) + cy.getNthVirtualArticle(i).get('.status-header span').should('contain', 'favorited') + } cy.wait(50) cy.getNthVirtualArticle(i).scrollIntoView() cy.get('.loading-footer').should('not.exist') diff --git a/fixtures/dump.sql b/fixtures/dump.sql index 950abaa..4fc0024 100644 Binary files a/fixtures/dump.sql and b/fixtures/dump.sql differ diff --git a/fixtures/system.tgz b/fixtures/system.tgz index 46fa028..5d60146 100644 Binary files a/fixtures/system.tgz and b/fixtures/system.tgz differ