mutedBox.spec.jsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import MutedBox from 'sentry/components/mutedBox';
  3. describe('MutedBox', function () {
  4. describe('render()', function () {
  5. it('handles ignoreUntil', function () {
  6. const {container} = render(
  7. <MutedBox statusDetails={{ignoreUntil: '2017-06-21T19:45:10Z'}} />
  8. );
  9. expect(screen.getByText(/This issue has been ignored until/)).toBeInTheDocument();
  10. expect(container).toSnapshot();
  11. });
  12. it('handles ignoreCount', function () {
  13. const {container} = render(<MutedBox statusDetails={{ignoreUserCount: 100}} />);
  14. expect(
  15. screen.getByText(/This issue has been ignored until it affects/)
  16. ).toBeInTheDocument();
  17. expect(container).toSnapshot();
  18. });
  19. it('handles ignoreCount with ignoreWindow', function () {
  20. const {container} = render(
  21. <MutedBox statusDetails={{ignoreCount: 100, ignoreWindow: 1}} />
  22. );
  23. expect(
  24. screen.getByText(/This issue has been ignored until it occurs/)
  25. ).toBeInTheDocument();
  26. expect(container).toSnapshot();
  27. });
  28. it('handles ignoreUserCount', function () {
  29. const {container} = render(<MutedBox statusDetails={{ignoreUserCount: 100}} />);
  30. expect(
  31. screen.getByText(/This issue has been ignored until it affects/)
  32. ).toBeInTheDocument();
  33. expect(container).toSnapshot();
  34. });
  35. it('handles ignoreUserCount with ignoreUserWindow', function () {
  36. const {container} = render(
  37. <MutedBox statusDetails={{ignoreUserCount: 100, ignoreUserWindow: 1}} />
  38. );
  39. expect(
  40. screen.getByText(/This issue has been ignored until it affects/)
  41. ).toBeInTheDocument();
  42. expect(container).toSnapshot();
  43. });
  44. it('handles default', function () {
  45. const {container} = render(<MutedBox statusDetails={{}} />);
  46. expect(screen.getByText(/This issue has been ignored/)).toBeInTheDocument();
  47. expect(container).toSnapshot();
  48. });
  49. });
  50. });