mutedBox.spec.tsx 1.5 KB

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