diff --git a/webapp/src/components/viewHeader/__snapshots__/viewHeaderActionsMenu.test.tsx.snap b/webapp/src/components/viewHeader/__snapshots__/viewHeaderActionsMenu.test.tsx.snap
index 0402f7dc9..639257522 100644
--- a/webapp/src/components/viewHeader/__snapshots__/viewHeaderActionsMenu.test.tsx.snap
+++ b/webapp/src/components/viewHeader/__snapshots__/viewHeaderActionsMenu.test.tsx.snap
@@ -1,5 +1,225 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`components/viewHeader/viewHeaderActionsMenu return menu and verify call to board archive 1`] = `
+
{
users: {
me: {
id: 'user-id-1',
- username: 'username_1'},
+ username: 'username_1',
+ },
},
}
- const mockStore = configureStore([])
- const store = mockStore(state)
-
+ const store = mockStateStore([], state)
+ beforeEach(() => {
+ jest.clearAllMocks()
+ })
test('return menu with Share Boards', () => {
const {container} = render(
wrapIntl(
@@ -43,7 +55,9 @@ describe('components/viewHeader/viewHeaderActionsMenu', () => {
,
),
)
- const buttonElement = screen.getByRole('button', {name: 'menuwrapper'})
+ const buttonElement = screen.getByRole('button', {
+ name: 'menuwrapper',
+ })
userEvent.click(buttonElement)
expect(container).toMatchSnapshot()
})
@@ -61,8 +75,52 @@ describe('components/viewHeader/viewHeaderActionsMenu', () => {
,
),
)
- const buttonElement = screen.getByRole('button', {name: 'menuwrapper'})
+ const buttonElement = screen.getByRole('button', {
+ name: 'menuwrapper',
+ })
userEvent.click(buttonElement)
expect(container).toMatchSnapshot()
})
+ test('return menu and verify call to csv exporter', () => {
+ const {container} = render(
+ wrapIntl(
+
+
+ ,
+ ),
+ )
+ const buttonElement = screen.getByRole('button', {name: 'menuwrapper'})
+ userEvent.click(buttonElement)
+ expect(container).toMatchSnapshot()
+ const buttonExportCSV = screen.getByRole('button', {name: 'Export to CSV'})
+ userEvent.click(buttonExportCSV)
+ expect(mockedCsvExporter.exportTableCsv).toBeCalledTimes(1)
+ })
+
+ test('return menu and verify call to board archive', () => {
+ const {container} = render(
+ wrapIntl(
+
+
+ ,
+ ),
+ )
+ const buttonElement = screen.getByRole('button', {name: 'menuwrapper'})
+ userEvent.click(buttonElement)
+ expect(container).toMatchSnapshot()
+ const buttonExportBoardArchive = screen.getByRole('button', {name: 'Export board archive'})
+ userEvent.click(buttonExportBoardArchive)
+ expect(mockedArchiver.exportBoardArchive).toBeCalledTimes(1)
+ expect(mockedArchiver.exportBoardArchive).toBeCalledWith(board)
+ })
})