Fix cypress tests

This commit is contained in:
roschaefer 2019-08-30 02:13:58 +02:00
parent f635b0cbd5
commit 66b12090a7
3 changed files with 4 additions and 4 deletions

View File

@ -357,7 +357,7 @@ When("mention {string} in the text", mention => {
});
Then("the notification gets marked as read", () => {
cy.get(".post.createdAt")
cy.get(".notifications-menu-popover .notification")
.first()
.should("have.class", "read");
});

View File

@ -1,5 +1,5 @@
<template>
<ds-space :class="[{ read: notification.read }, notification]" margin-bottom="x-small">
<ds-space :class="{ read: notification.read, notification: true}" margin-bottom="x-small">
<client-only>
<ds-space margin-bottom="x-small">
<hc-user :user="from.author" :date-time="from.createdAt" :trunc="35" />

View File

@ -46,8 +46,8 @@ export default {
variables,
})
if (!(markAsRead && markAsRead.read === true)) return
this.notifications = this.notifications.filter(n => {
return n.from.id !== markAsRead.from.id
this.notifications = this.notifications.map(n => {
return (n.from.id === markAsRead.from.id) ? markAsRead : n
})
} catch (err) {
throw new Error(err)