Fix: linting, integration tests

This commit is contained in:
Raphael Beer 2020-02-28 13:37:14 +01:00
parent d5cbfb142f
commit 8ffda5e908
No known key found for this signature in database
GPG Key ID: C1AC5E018B25EF11
4 changed files with 15 additions and 12 deletions

View File

@ -422,14 +422,13 @@ When("mention {string} in the text", mention => {
.click(); .click();
}); });
Then("the notification gets marked as read", () => { Then("the unread counter is removed", () => {
cy.get(".notifications-menu-popover .notification") cy.get('.notifications-menu .counter-icon').should('not.exist');
.first()
.should("have.class", "--read");
}); });
Then("there are no notifications in the top menu", () => { Then("the notification menu button links to the all notifications page", () => {
cy.get(".notifications-menu").should("contain", "0"); cy.get(".notifications-menu").click();
cy.location("pathname").should("contain", "/notifications");
}); });
Given("there is an annoying user called {string}", name => { Given("there is an annoying user called {string}", name => {

View File

@ -24,6 +24,6 @@ Feature: Notification for a mention
And see 1 unread notifications in the top menu And see 1 unread notifications in the top menu
And open the notification menu and click on the first item And open the notification menu and click on the first item
Then I get to the post page of ".../hey-matt" Then I get to the post page of ".../hey-matt"
And the notification gets marked as read And the unread counter is removed
But when I refresh the page And the notification menu button links to the all notifications page
Then there are no notifications in the top menu

View File

@ -22,7 +22,7 @@ describe('NotificationMenu.vue', () => {
} }
} }
stubs = { stubs = {
NuxtLink: RouterLinkStub NuxtLink: RouterLinkStub,
} }
}) })
@ -32,7 +32,7 @@ describe('NotificationMenu.vue', () => {
data, data,
mocks, mocks,
localVue, localVue,
stubs stubs,
}) })
} }

View File

@ -1,5 +1,9 @@
<template> <template>
<nuxt-link v-if="!unreadNotificationsCount" class="notifications-menu" :to="{ name: 'notifications' }"> <nuxt-link
v-if="!unreadNotificationsCount"
class="notifications-menu"
:to="{ name: 'notifications' }"
>
<base-button icon="bell" ghost circle /> <base-button icon="bell" ghost circle />
</nuxt-link> </nuxt-link>
<dropdown v-else class="notifications-menu" offset="8" :placement="placement"> <dropdown v-else class="notifications-menu" offset="8" :placement="placement">