test: Improve test coverage to 100% for users views (#188)
This commit is contained in:
@@ -35,6 +35,13 @@ describe('User.vue', () => {
|
||||
|
||||
expect(typeof User.methods.goBack ).toEqual('function')
|
||||
expect(wrapper.vm.goBack()).toBeUndefined()
|
||||
expect(typeof User.methods.getUserData ).toEqual('function')
|
||||
expect(wrapper.vm.getUserData(1)).toStrictEqual([
|
||||
{ key: 'username', value: 'Samppa Nori' },
|
||||
{ key: 'registered', value: '2012/01/01' },
|
||||
{ key: 'role', value: 'Member' },
|
||||
{ key: 'status', value: 'Active' } ])
|
||||
expect(wrapper.vm.getUserData(30)).toStrictEqual([{"key": "id", "value": "Not found"}])
|
||||
})
|
||||
test('renders correctly', () => {
|
||||
const wrapper = shallowMount(User, {
|
||||
|
||||
Reference in New Issue
Block a user