diff --git a/webapp/src/components/viewHeader/__snapshots__/viewHeader.test.tsx.snap b/webapp/src/components/viewHeader/__snapshots__/viewHeader.test.tsx.snap
new file mode 100644
index 000000000..d91baf3c8
--- /dev/null
+++ b/webapp/src/components/viewHeader/__snapshots__/viewHeader.test.tsx.snap
@@ -0,0 +1,183 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`components/viewHeader/viewHeader return viewHeader 1`] = `
+
+
+
+`;
+
+exports[`components/viewHeader/viewHeader return viewHeader readonly 1`] = `
+
+
+
+`;
diff --git a/webapp/src/components/viewHeader/viewHeader.test.tsx b/webapp/src/components/viewHeader/viewHeader.test.tsx
new file mode 100644
index 000000000..66f7e3e6c
--- /dev/null
+++ b/webapp/src/components/viewHeader/viewHeader.test.tsx
@@ -0,0 +1,82 @@
+// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
+// See LICENSE.txt for license information.
+
+import React from 'react'
+import {render} from '@testing-library/react'
+import {Provider as ReduxProvider} from 'react-redux'
+
+import '@testing-library/jest-dom'
+
+import {TestBlockFactory} from '../../test/testBlockFactory'
+
+import {wrapIntl, mockStateStore} from '../../testUtils'
+
+import ViewHeader from './viewHeader'
+
+const board = TestBlockFactory.createBoard()
+const activeView = TestBlockFactory.createBoardView(board)
+const card = TestBlockFactory.createCard(board)
+
+describe('components/viewHeader/viewHeader', () => {
+ const state = {
+ users: {
+ me: {
+ id: 'user-id-1',
+ username: 'username_1',
+ },
+ },
+ searchText: {
+ },
+ boards: {
+ current: board,
+ },
+ cards: {
+ templates: [card],
+ },
+ }
+ const store = mockStateStore([], state)
+ test('return viewHeader', () => {
+ const {container} = render(
+ wrapIntl(
+
+
+ ,
+ ),
+ )
+ expect(container).toMatchSnapshot()
+ })
+ test('return viewHeader readonly', () => {
+ const {container} = render(
+ wrapIntl(
+
+
+ ,
+ ),
+ )
+ expect(container).toMatchSnapshot()
+ })
+})
diff --git a/webapp/src/testUtils.tsx b/webapp/src/testUtils.tsx
index 61e368ab4..4b19622a5 100644
--- a/webapp/src/testUtils.tsx
+++ b/webapp/src/testUtils.tsx
@@ -2,6 +2,8 @@
// See LICENSE.txt for license information.
import {IntlProvider} from 'react-intl'
import React from 'react'
+import configureStore, {MockStoreEnhanced} from 'redux-mock-store'
+import {Middleware} from 'redux'
export const wrapIntl = (children?: React.ReactNode): JSX.Element => {children}
@@ -39,3 +41,8 @@ export function mockMatchMedia(result: any): void {
}),
})
}
+
+export function mockStateStore(middleware:Middleware[], state:unknown): MockStoreEnhanced {
+ const mockStore = configureStore(middleware)
+ return mockStore(state)
+}