We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69a68cd commit 2ef15e8Copy full SHA for 2ef15e8
1 file changed
__tests__/header.test.js
@@ -0,0 +1,17 @@
1
+import React from 'react'
2
+import {render} from '@testing-library/react'
3
+import userEvent from '@testing-library/user-event'
4
+import {Header} from '../src/components'
5
+
6
+describe('Header menu', () => {
7
+ test('Has title, element list without action', () => {
8
+ const text = 'Test'
9
+ const navMenu = [{url: '', text: 'Logout'}]
10
11
+ const {getByText} = render(<Header text={text} navMenu={navMenu} />)
12
+ const menuItem = getByText(/logout/i)
13
+ expect(getByText(/test/i)).toBeInTheDocument()
14
+ expect(menuItem).toBeInTheDocument()
15
+ userEvent.click(menuItem)
16
+ })
17
+})
0 commit comments