We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60d43a5 commit a53cec6Copy full SHA for a53cec6
tests/unit/AppHeader.spec.js
@@ -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
12
+ await wrapper.setData({ loggedIn: true })
13
14
+ expect(wrapper.find('button').isVisible()).toBe(true)
15
16
+})
0 commit comments