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();
});
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 => {

View File

@ -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

View File

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

View File

@ -1,5 +1,9 @@
<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 />
</nuxt-link>
<dropdown v-else class="notifications-menu" offset="8" :placement="placement">