Skip to content

Commit 2ef15e8

Browse files
committed
Test header without nav menu actions
1 parent 69a68cd commit 2ef15e8

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

__tests__/header.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)