android.spec.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {StepTitle} from 'sentry/components/onboarding/gettingStartedDoc/step';
  3. import {GettingStartedWithAndroid, InstallationMode, steps} from './android';
  4. describe('GettingStartedWithAndroid', function () {
  5. it('renders doc correctly', function () {
  6. render(<GettingStartedWithAndroid dsn="test-dsn" projectSlug="test-project" />);
  7. // Steps
  8. for (const step of steps({
  9. dsn: 'test-dsn',
  10. hasPerformance: true,
  11. hasProfiling: true,
  12. installationMode: InstallationMode.AUTO,
  13. })) {
  14. expect(
  15. screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
  16. ).toBeInTheDocument();
  17. }
  18. });
  19. it('renders Manual mode for Windows by default', function () {
  20. Object.defineProperty(window.navigator, 'userAgent', {
  21. value:
  22. 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7',
  23. });
  24. render(<GettingStartedWithAndroid dsn="test-dsn" projectSlug="test-project" />);
  25. // Steps
  26. for (const step of steps({
  27. dsn: 'test-dsn',
  28. hasPerformance: true,
  29. hasProfiling: true,
  30. installationMode: InstallationMode.MANUAL,
  31. })) {
  32. expect(
  33. screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
  34. ).toBeInTheDocument();
  35. }
  36. });
  37. });