1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import {initializeOrg} from 'sentry-test/initializeOrg';
- import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
- import {textWithMarkupMatcher} from 'sentry-test/utils';
- import {EventSdk} from 'sentry/components/events/eventSdk';
- import {OrganizationContext} from 'sentry/views/organizationContext';
- import {RouteContext} from 'sentry/views/routeContext';
- describe('event sdk', function () {
- it('display redacted tags', async function () {
- const {organization, router} = initializeOrg({
- ...initializeOrg(),
- organization: {
- ...initializeOrg().organization,
- relayPiiConfig: JSON.stringify(TestStubs.DataScrubbingRelayPiiConfig()),
- },
- });
- const event = {
- ...TestStubs.Event(),
- sdk: {
- name: 'sentry.cocoa',
- version: '',
- },
- _meta: {
- sdk: {
- version: {'': {rem: [['organization:0', 'x']]}},
- },
- },
- };
- render(
- <OrganizationContext.Provider value={organization}>
- <RouteContext.Provider
- value={{
- router,
- location: router.location,
- params: {},
- routes: [],
- }}
- >
- <EventSdk sdk={event.sdk} meta={event._meta.sdk} />
- </RouteContext.Provider>
- </OrganizationContext.Provider>
- );
- userEvent.hover(screen.getByText(/redacted/));
- expect(
- await screen.findByText(
- textWithMarkupMatcher(
- 'Removed because of the PII rule [Replace] [Password fields] with [Scrubbed] from [password] in the settings of the organization org-slug'
- )
- )
- ).toBeInTheDocument(); // tooltip description
- });
- });
|