Spaces:
Sleeping
Sleeping
File size: 1,582 Bytes
13555f3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | // 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 '@testing-library/jest-dom'
import 'isomorphic-fetch'
import {wrapDNDIntl} from '../../testUtils'
import {TestBlockFactory} from '../../test/testBlockFactory'
import {ColumnResizeProvider} from './tableColumnResizeContext'
import TableHeader from './tableHeader'
describe('components/table/TableHeaderMenu', () => {
const board = TestBlockFactory.createBoard()
const view = TestBlockFactory.createBoardView(board)
const view2 = TestBlockFactory.createBoardView(board)
view2.fields.sortOptions = []
test('should match snapshot, title column', async () => {
const onAutoSizeColumn = jest.fn()
const component = wrapDNDIntl(
<ColumnResizeProvider
columnWidths={{}}
onResizeColumn={jest.fn()}
>
<TableHeader
readonly={false}
sorted={'none'}
name={'my Name'}
board={board}
activeView={view}
cards={[]}
views={[view, view2]}
template={board.cardProperties[0]}
onDrop={jest.fn()}
onAutoSizeColumn={onAutoSizeColumn}
/>
</ColumnResizeProvider>,
)
const {container} = render(component)
expect(container).toMatchSnapshot()
})
})
|