// 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 {render} from '@testing-library/react'
import configureStore from 'redux-mock-store'
import '@testing-library/jest-dom'
import {wrapDNDIntl} from '../../testUtils'
import 'isomorphic-fetch'
import {TestBlockFactory} from '../../test/testBlockFactory'
import {ColumnResizeProvider} from './tableColumnResizeContext'
import TableRow from './tableRow'
describe('components/table/TableRow', () => {
const board = TestBlockFactory.createBoard()
const view = TestBlockFactory.createBoardView(board)
const view2 = TestBlockFactory.createBoardView(board)
view2.fields.sortOptions = []
const card = TestBlockFactory.createCard(board)
const cardTemplate = TestBlockFactory.createCard(board)
cardTemplate.fields.isTemplate = true
const state = {
users: {},
comments: {
comments: {},
},
contents: {
contents: {},
},
cards: {
cards: {
[card.id]: card,
},
},
}
const mockStore = configureStore([])
const Wrapper: React.FC = ({children}) => {
const store = mockStore(state)
return wrapDNDIntl(
{children}
,
)
}
test('should match snapshot', async () => {
const {container} = render(
,
)
expect(container).toMatchSnapshot()
})
test('should match snapshot, read-only', async () => {
const {container} = render(
,
)
expect(container).toMatchSnapshot()
})
test('should match snapshot, isSelected', async () => {
const {container} = render(
,
)
expect(container).toMatchSnapshot()
})
test('should match snapshot, collapsed tree', async () => {
const {container} = render(
,
)
expect(container).toMatchSnapshot()
})
test('should match snapshot, display properties', async () => {
const {container} = render(
,
)
expect(container).toMatchSnapshot()
})
test('should match snapshot, resizing column', async () => {
const {container} = render(
,
)
expect(container).toMatchSnapshot()
})
})