guestBadge.test.tsx
TLDR
This file is a test file for the GuestBadge
component. It contains two test cases: one for when the show
prop is true
and one for when the show
prop is false
. The tests check if the rendered output matches the expected snapshots.
Methods
// 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 {wrapIntl} from '../testUtils'
import GuestBadge from './guestBadge'
describe('widgets/guestBadge', () => {
test('should match the snapshot on show', () => {
const {container} = render(wrapIntl(<GuestBadge show={true}/>))
expect(container).toMatchSnapshot()
})
test('should match the snapshot on hide', () => {
const {container} = render(wrapIntl(<GuestBadge show={false}/>))
expect(container).toMatchInlineSnapshot('<div />')
})
})