// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import '@testing-library/jest-dom'
import {render} from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import React from 'react'
import {MemberRole} from '../blocks/board'
import {wrapDNDIntl} from '../testUtils'
import {IUser} from '../user'
import ConfirmAddUserForNotifications from './confirmAddUserForNotifications'
describe('/components/confirmAddUserForNotifications', () => {
it('should match snapshot', async () => {
const result = render(
wrapDNDIntl(
,
),
)
expect(result.container).toMatchSnapshot()
})
it('confirm button click, run onConfirm Function once', () => {
const onConfirm = jest.fn()
const result = render(
wrapDNDIntl(
,
),
)
userEvent.click(result.getByTitle('Add to board'))
expect(onConfirm).toBeCalledTimes(1)
})
it('cancel button click runs onClose function', () => {
const onClose = jest.fn()
const result = render(
wrapDNDIntl(
,
),
)
userEvent.click(result.getByTitle('Cancel'))
expect(onClose).toBeCalledTimes(1)
})
})