NotificationList.vue with default as afunction tested

This commit is contained in:
Ulf Gebhardt 2021-04-24 13:25:03 +02:00
parent 72addd1336
commit 6e5e15097e
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
2 changed files with 20 additions and 1 deletions

View File

@ -81,4 +81,23 @@ describe('NotificationList.vue', () => {
})
})
})
describe('shallowMount with no notifications', () => {
const Wrapper = () => {
return shallowMount(NotificationList, {
propsData: {},
mocks,
store,
localVue,
})
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders Notification.vue zero times', () => {
expect(wrapper.findAll(Notification)).toHaveLength(0)
})
})
})

View File

@ -20,7 +20,7 @@ export default {
props: {
notifications: {
type: Array,
default: [],
default: () => [],
},
},
methods: {