Skip to content

Commit a53cec6

Browse files
AndyAndy
authored andcommitted
ending
1 parent 60d43a5 commit a53cec6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/unit/AppHeader.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import AppHeader from '@/components/AppHeader'
2+
import { mount } from '@vue/test-utils'
3+
4+
describe('AppHeader', () => {
5+
test('if user is not logged in, do not show logout button', () => {
6+
const wrapper = mount(AppHeader)
7+
expect(wrapper.find('button').isVisible()).toBe(false)
8+
})
9+
10+
test('if logged in, show logout button', async () => {
11+
const wrapper = mount(AppHeader)
12+
await wrapper.setData({ loggedIn: true })
13+
14+
expect(wrapper.find('button').isVisible()).toBe(true)
15+
})
16+
})

0 commit comments

Comments
 (0)