Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(tests) Move tests for MutedBox to RTL #29967

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions tests/js/spec/components/mutedBox.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
import {mountWithTheme} from 'sentry-test/enzyme';
import {mountWithTheme, screen} from 'sentry-test/reactTestingLibrary';

import MutedBox from 'app/components/mutedBox';

describe('MutedBox', function () {
describe('render()', function () {
it('handles ignoreUntil', function () {
const wrapper = mountWithTheme(
const {container} = mountWithTheme(
<MutedBox statusDetails={{ignoreUntil: '2017-06-21T19:45:10Z'}} />
);
expect(wrapper).toSnapshot();
expect(screen.getByText(/This issue has been ignored until/)).toBeInTheDocument();
expect(container).toSnapshot();
});
it('handles ignoreCount', function () {
const wrapper = mountWithTheme(<MutedBox statusDetails={{ignoreUserCount: 100}} />);
expect(wrapper).toSnapshot();
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 wrapper = mountWithTheme(
const {container} = mountWithTheme(
<MutedBox statusDetails={{ignoreCount: 100, ignoreWindow: 1}} />
);
expect(wrapper).toSnapshot();
expect(
screen.getByText(/This issue has been ignored until it occurs/)
).toBeInTheDocument();
expect(container).toSnapshot();
});
it('handles ignoreUserCount', function () {
const wrapper = mountWithTheme(<MutedBox statusDetails={{ignoreUserCount: 100}} />);
expect(wrapper).toSnapshot();
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 wrapper = mountWithTheme(
const {container} = mountWithTheme(
<MutedBox statusDetails={{ignoreUserCount: 100, ignoreUserWindow: 1}} />
);
expect(wrapper).toSnapshot();
expect(
screen.getByText(/This issue has been ignored until it affects/)
).toBeInTheDocument();
expect(container).toSnapshot();
});
it('handles default', function () {
const wrapper = mountWithTheme(<MutedBox statusDetails={{}} />);
expect(wrapper).toSnapshot();
const {container} = mountWithTheme(<MutedBox statusDetails={{}} />);
expect(screen.getByText(/This issue has been ignored/)).toBeInTheDocument();
expect(container).toSnapshot();
});
});
});