globalHeader.test.tsx
TLDR
This file is a unit test file for the GlobalHeader
component in the components/globalHeader
directory of the Demo Projects project.
Methods
This file does not contain any methods.
Classes
This file does not contain any classes.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
import {Provider as ReduxProvider} from 'react-redux'
import {createMemoryHistory} from 'history'
import {render} from '@testing-library/react'
import configureStore from 'redux-mock-store'
import {wrapIntl} from '../../testUtils'
import GlobalHeader from './globalHeader'
describe('components/sidebar/GlobalHeader', () => {
const mockStore = configureStore([])
const history = createMemoryHistory()
let store = mockStore({})
beforeEach(() => {
store = mockStore({})
})
test('header menu should match snapshot', () => {
const component = wrapIntl(
<ReduxProvider store={store}>
<GlobalHeader history={history}/>
</ReduxProvider>,
)
const {container} = render(component)
expect(container).toMatchSnapshot()
})
})