generic.spec.tsx 1020 B

1234567891011121314151617181920212223242526272829303132
  1. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  2. import {textWithMarkupMatcher} from 'sentry-test/utils';
  3. import {Generic} from 'sentry/components/events/interfaces/generic';
  4. describe('Generic entry', function () {
  5. it('display redacted data', async function () {
  6. const event = {
  7. ...TestStubs.Event(),
  8. _meta: {
  9. hpkp: {'': {rem: [['organization:1', 'x']]}},
  10. },
  11. };
  12. render(<Generic type="hpkp" data={null} meta={event._meta.hpkp} />, {
  13. organization: {
  14. relayPiiConfig: JSON.stringify(TestStubs.DataScrubbingRelayPiiConfig()),
  15. },
  16. });
  17. expect(screen.getByText(/redacted/)).toBeInTheDocument();
  18. userEvent.hover(screen.getByText(/redacted/));
  19. expect(
  20. await screen.findByText(
  21. textWithMarkupMatcher(
  22. "Removed because of the data scrubbing rule [Mask] [Credit card numbers] from [$message] in your organization's settings"
  23. )
  24. )
  25. ).toBeInTheDocument(); // tooltip description
  26. });
  27. });