From 8ffda5e908d0524d21dbc7cc45b005d69bd7eaea Mon Sep 17 00:00:00 2001 From: Raphael Beer Date: Fri, 28 Feb 2020 13:37:14 +0100 Subject: [PATCH] Fix: linting, integration tests --- cypress/integration/common/steps.js | 11 +++++------ cypress/integration/notifications/Mentions.feature | 6 +++--- .../NotificationMenu/NotificationMenu.spec.js | 4 ++-- .../components/NotificationMenu/NotificationMenu.vue | 6 +++++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index c02829b25..468ce578a 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -422,14 +422,13 @@ When("mention {string} in the text", mention => { .click(); }); -Then("the notification gets marked as read", () => { - cy.get(".notifications-menu-popover .notification") - .first() - .should("have.class", "--read"); +Then("the unread counter is removed", () => { + cy.get('.notifications-menu .counter-icon').should('not.exist'); }); -Then("there are no notifications in the top menu", () => { - cy.get(".notifications-menu").should("contain", "0"); +Then("the notification menu button links to the all notifications page", () => { + cy.get(".notifications-menu").click(); + cy.location("pathname").should("contain", "/notifications"); }); Given("there is an annoying user called {string}", name => { diff --git a/cypress/integration/notifications/Mentions.feature b/cypress/integration/notifications/Mentions.feature index 08eddcacd..1cf265624 100644 --- a/cypress/integration/notifications/Mentions.feature +++ b/cypress/integration/notifications/Mentions.feature @@ -24,6 +24,6 @@ Feature: Notification for a mention And see 1 unread notifications in the top menu And open the notification menu and click on the first item Then I get to the post page of ".../hey-matt" - And the notification gets marked as read - But when I refresh the page - Then there are no notifications in the top menu + And the unread counter is removed + And the notification menu button links to the all notifications page + diff --git a/webapp/components/NotificationMenu/NotificationMenu.spec.js b/webapp/components/NotificationMenu/NotificationMenu.spec.js index 2f6227810..a44d7a94d 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.spec.js +++ b/webapp/components/NotificationMenu/NotificationMenu.spec.js @@ -22,7 +22,7 @@ describe('NotificationMenu.vue', () => { } } stubs = { - NuxtLink: RouterLinkStub + NuxtLink: RouterLinkStub, } }) @@ -32,7 +32,7 @@ describe('NotificationMenu.vue', () => { data, mocks, localVue, - stubs + stubs, }) } diff --git a/webapp/components/NotificationMenu/NotificationMenu.vue b/webapp/components/NotificationMenu/NotificationMenu.vue index d20672965..fb047a0c3 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.vue +++ b/webapp/components/NotificationMenu/NotificationMenu.vue @@ -1,5 +1,9 @@