Grey out a read notification + test it

This commit is contained in:
Robert Schäfer 2019-04-18 17:11:22 +02:00
parent a1744d363c
commit 6c37f525c5
2 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<template>
<ds-space
:class='{"notification": true, "read": notification.read}'
:class="{'notification': true, 'read': notification.read}"
margin-bottom="x-small"
>
<no-ssr>
@ -62,3 +62,10 @@ export default {
}
}
</script>
<style>
.notification.read {
opacity: 0.6; /* Real browsers */
filter: alpha(opacity = 60); /* MSIE */
}
</style>

View File

@ -46,5 +46,19 @@ describe('Notification', () => {
it('renders title', () => {
expect(Wrapper().text()).toContain("It's a title")
})
it('has no class "read"', () => {
expect(Wrapper().classes()).not.toContain('read')
})
describe('that is read', () => {
beforeEach(() => {
propsData.notification.read = true
})
it('has class "read"', () => {
expect(Wrapper().classes()).toContain('read')
})
})
})
})