mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import {OrganizationFixture} from 'sentry-fixture/organization';
|
|
|
|
import {render, screen} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import BaseBadge from 'sentry/components/idBadge/baseBadge';
|
|
|
|
describe('BadgeBadge', function () {
|
|
it('has a display name', function () {
|
|
render(
|
|
<BaseBadge
|
|
organization={OrganizationFixture()}
|
|
displayName={<span>display name</span>}
|
|
/>
|
|
);
|
|
expect(screen.getByText('display name')).toBeInTheDocument();
|
|
});
|
|
|
|
it('can hide avatar', function () {
|
|
render(
|
|
<BaseBadge organization={OrganizationFixture()} displayName="hello" hideAvatar />
|
|
);
|
|
expect(screen.queryByTestId('badge-styled-avatar')).not.toBeInTheDocument();
|
|
expect(screen.getByTestId('badge-display-name')).toHaveTextContent('hello');
|
|
});
|
|
|
|
it('can hide name', function () {
|
|
render(
|
|
<BaseBadge
|
|
organization={OrganizationFixture()}
|
|
hideName
|
|
displayName={<span>display name</span>}
|
|
/>
|
|
);
|
|
expect(screen.queryByText('display name')).not.toBeInTheDocument();
|
|
});
|
|
});
|