1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import {mountWithTheme, screen} from 'sentry-test/reactTestingLibrary';
- import MutedBox from 'sentry/components/mutedBox';
- describe('MutedBox', function () {
- describe('render()', function () {
- it('handles ignoreUntil', function () {
- const {container} = mountWithTheme(
- <MutedBox statusDetails={{ignoreUntil: '2017-06-21T19:45:10Z'}} />
- );
- expect(screen.getByText(/This issue has been ignored until/)).toBeInTheDocument();
- expect(container).toSnapshot();
- });
- it('handles ignoreCount', function () {
- const {container} = mountWithTheme(
- <MutedBox statusDetails={{ignoreUserCount: 100}} />
- );
- expect(
- screen.getByText(/This issue has been ignored until it affects/)
- ).toBeInTheDocument();
- expect(container).toSnapshot();
- });
- it('handles ignoreCount with ignoreWindow', function () {
- const {container} = mountWithTheme(
- <MutedBox statusDetails={{ignoreCount: 100, ignoreWindow: 1}} />
- );
- expect(
- screen.getByText(/This issue has been ignored until it occurs/)
- ).toBeInTheDocument();
- expect(container).toSnapshot();
- });
- it('handles ignoreUserCount', function () {
- const {container} = mountWithTheme(
- <MutedBox statusDetails={{ignoreUserCount: 100}} />
- );
- expect(
- screen.getByText(/This issue has been ignored until it affects/)
- ).toBeInTheDocument();
- expect(container).toSnapshot();
- });
- it('handles ignoreUserCount with ignoreUserWindow', function () {
- const {container} = mountWithTheme(
- <MutedBox statusDetails={{ignoreUserCount: 100, ignoreUserWindow: 1}} />
- );
- expect(
- screen.getByText(/This issue has been ignored until it affects/)
- ).toBeInTheDocument();
- expect(container).toSnapshot();
- });
- it('handles default', function () {
- const {container} = mountWithTheme(<MutedBox statusDetails={{}} />);
- expect(screen.getByText(/This issue has been ignored/)).toBeInTheDocument();
- expect(container).toSnapshot();
- });
- });
- });
|