diff --git a/cypress/integration/03-basic-timeline-spec.js b/cypress/integration/03-basic-timeline-spec.js index 8b24822..58496d1 100644 --- a/cypress/integration/03-basic-timeline-spec.js +++ b/cypress/integration/03-basic-timeline-spec.js @@ -28,6 +28,12 @@ describe('Basic timeline spec', () => { localTimeline.splice(0, 3) localTimeline.splice(9, 2) + const notifications = [ + {followedBy: 'quux'}, + {content: 'hello foobar'}, + {followedBy: 'admin'} + ] + 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') @@ -37,6 +43,14 @@ describe('Basic timeline spec', () => { cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-setsize', (30 + 15).toString()) }) + it('Shows notifications', () => { + cy.get('nav a').contains('Notifications').click() + cy.url().should('contain', '/notifications') + + cy.validateTimeline(notifications) + + }) + it('Shows the local timeline', () => { cy.get('nav a').contains('Local').click() cy.url().should('contain', '/local') diff --git a/cypress/support/commands.js b/cypress/support/commands.js index b787499..70f552b 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -48,7 +48,7 @@ Cypress.Commands.add('login', (email, password) => { }) Cypress.Commands.add('getNthVirtualArticle', (n) => { - return cy.get(`.virtual-list-item[aria-hidden=false] .status-article[aria-posinset=${n}]`) + return cy.get(`.virtual-list-item[aria-hidden=false] article[aria-posinset=${n}]`) }) Cypress.Commands.add('validateTimeline', (timeline) => { @@ -59,6 +59,10 @@ Cypress.Commands.add('validateTimeline', (timeline) => { if (status.spoiler) { cy.getNthVirtualArticle(i).get('.status-spoiler p').should('contain', status.spoiler) } + if (status.followedBy) { + cy.getNthVirtualArticle(i).get('.status-header span').should('contain', status.followedBy) + cy.getNthVirtualArticle(i).get('.status-header span').should('contain', 'followed you') + } cy.getNthVirtualArticle(i).scrollIntoView() }) }) \ No newline at end of file diff --git a/fixtures/dump.sql b/fixtures/dump.sql index 70e6f78..950abaa 100644 Binary files a/fixtures/dump.sql and b/fixtures/dump.sql differ diff --git a/fixtures/system.tgz b/fixtures/system.tgz index f231ef4..46fa028 100644 Binary files a/fixtures/system.tgz and b/fixtures/system.tgz differ