packageData.spec.tsx 946 B

1234567891011121314151617181920212223242526272829303132333435
  1. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  2. import {EventPackageData} from 'sentry/components/events/packageData';
  3. describe('EventPackageData', function () {
  4. it('display redacted data', async function () {
  5. const event = {
  6. ...TestStubs.Event(),
  7. packages: {
  8. certifi: '',
  9. pip: '18.0',
  10. python: '2.7.15',
  11. 'sentry-sdk': '0.3.1',
  12. setuptools: '40.0.0',
  13. urllib3: '1.23',
  14. wheel: '0.31.1',
  15. wsgiref: '0.1.2',
  16. },
  17. _meta: {
  18. packages: {
  19. certifi: {'': {rem: [['project:1', 'x']]}},
  20. },
  21. },
  22. };
  23. render(<EventPackageData event={event} />);
  24. expect(screen.getByText(/redacted/)).toBeInTheDocument();
  25. userEvent.hover(screen.getByText(/redacted/));
  26. expect(
  27. await screen.findByText('Removed because of PII rule "project:1"')
  28. ).toBeInTheDocument(); // tooltip description
  29. });
  30. });