samplingSDKClientRateChangeAlert.spec.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {SamplingSDKClientRateChangeAlert} from 'sentry/views/settings/project/server-side-sampling/samplingSDKClientRateChangeAlert';
  3. import {getMockData} from './testUtils';
  4. describe('Server-Side Sampling - Client Rate Change Alert', function () {
  5. it('does not render content', function () {
  6. const {organization, project} = getMockData();
  7. render(
  8. <SamplingSDKClientRateChangeAlert
  9. organization={organization}
  10. projectId={project.id}
  11. onReadDocs={jest.fn()}
  12. projectStats={TestStubs.Outcomes()}
  13. />
  14. );
  15. expect(
  16. screen.queryByText(
  17. 'To allow more transactions to be processed, we suggest changing your client(SDK) sample rate.'
  18. )
  19. ).not.toBeInTheDocument();
  20. });
  21. it('renders content with change sdk sample rate info', function () {
  22. const {organization, project} = getMockData();
  23. render(
  24. <SamplingSDKClientRateChangeAlert
  25. organization={organization}
  26. projectId={project.id}
  27. onReadDocs={jest.fn()}
  28. projectStats={TestStubs.OutcomesWithLowProcessedEvents()}
  29. />
  30. );
  31. expect(
  32. screen.getByText(
  33. 'To allow more transactions to be processed, we suggest changing your client(SDK) sample rate.'
  34. )
  35. ).toBeInTheDocument();
  36. });
  37. });