platform.spec.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {initializeOrg} from 'sentry-test/initializeOrg';
  2. import {render, screen} from 'sentry-test/reactTestingLibrary';
  3. import {ProjectInstallPlatform} from 'sentry/views/projectInstall/platform';
  4. describe('ProjectInstallPlatform', function () {
  5. it('should render NotFound if no matching integration/platform', async function () {
  6. const routeParams = {
  7. projectId: TestStubs.Project().slug,
  8. platform: 'lua',
  9. };
  10. const {organization, router, route, project, routerContext} = initializeOrg({
  11. ...initializeOrg(),
  12. router: {
  13. location: {
  14. query: {},
  15. },
  16. params: routeParams,
  17. },
  18. });
  19. MockApiClient.addMockResponse({
  20. method: 'GET',
  21. url: '/organizations/org-slug/projects/',
  22. body: [project],
  23. });
  24. render(
  25. <ProjectInstallPlatform
  26. router={router}
  27. route={route}
  28. location={router.location}
  29. routeParams={routeParams}
  30. routes={router.routes}
  31. params={routeParams}
  32. />,
  33. {
  34. organization,
  35. context: routerContext,
  36. }
  37. );
  38. expect(await screen.findByText('Page Not Found')).toBeInTheDocument();
  39. });
  40. });