mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Give the test more sence
This commit is contained in:
parent
da5c63e97d
commit
d1444619ab
@ -79,12 +79,26 @@ describe('NotificationMenu.vue', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'notification-43',
|
||||
read: true,
|
||||
post: {
|
||||
id: 'post-3',
|
||||
title: 'red post title',
|
||||
contentExcerpt: 'this is yet another post content',
|
||||
author: {
|
||||
id: 'john-1',
|
||||
slug: 'john-doe',
|
||||
name: 'John Doe',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
it('displays the total number of notifications', () => {
|
||||
it('displays the unred number of notifications', () => {
|
||||
wrapper = Wrapper()
|
||||
expect(wrapper.find('ds-button-stub').text()).toEqual('2')
|
||||
})
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
@click.prevent="updateNotifications"
|
||||
>
|
||||
<ds-button class="notifications-menu" disabled icon="bell">
|
||||
{{ unreadNotifications }}
|
||||
{{ unredNotifications }}
|
||||
</ds-button>
|
||||
</div>
|
||||
<dropdown v-else class="notifications-menu" :placement="placement">
|
||||
@ -18,7 +18,7 @@
|
||||
updateNotifications()
|
||||
"
|
||||
>
|
||||
{{ unreadNotifications }}
|
||||
{{ unredNotifications }}
|
||||
</ds-button>
|
||||
</template>
|
||||
<template slot="popover">
|
||||
@ -104,7 +104,7 @@ export default {
|
||||
totalNotifications() {
|
||||
return (this.notifications || []).length
|
||||
},
|
||||
unreadNotifications() {
|
||||
unredNotifications() {
|
||||
let countUnread = 0
|
||||
if (this.notifications) {
|
||||
this.notifications.forEach(notification => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user