generic.spec.tsx 698 B

1234567891011121314151617181920212223
  1. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  2. import {Generic} from 'sentry/components/events/interfaces/generic';
  3. describe('Generic entry', function () {
  4. it('display redacted data', async function () {
  5. const event = {
  6. ...TestStubs.Event(),
  7. _meta: {
  8. hpkp: {'': {rem: [['project:1', 'x']]}},
  9. },
  10. };
  11. render(<Generic type="hpkp" data={null} meta={event._meta.hpkp} />);
  12. expect(screen.getByText(/redacted/)).toBeInTheDocument();
  13. userEvent.hover(screen.getByText(/redacted/));
  14. expect(
  15. await screen.findByText('Removed because of PII rule "project:1"')
  16. ).toBeInTheDocument(); // tooltip description
  17. });
  18. });