main

mattermost/focalboard

Last updated at: 29/12/2023 09:48

globalHeader.test.tsx

TLDR

This file is a test file for the GlobalHeader component of the Demo Projects project. It tests the header menu and matches it against a snapshot.

Methods

None

Classes

None

// 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()
    })
})