|
1 | | -import {render, screen} from 'sentry-test/reactTestingLibrary'; |
| 1 | +import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout'; |
| 2 | +import {screen} from 'sentry-test/reactTestingLibrary'; |
| 3 | +import {textWithMarkupMatcher} from 'sentry-test/utils'; |
2 | 4 |
|
3 | | -import {StepTitle} from 'sentry/components/onboarding/gettingStartedDoc/step'; |
4 | | -import {ProductSolution} from 'sentry/components/onboarding/productSelection'; |
| 5 | +import docs from './remix'; |
5 | 6 |
|
6 | | -import {GettingStartedWithRemix, nextSteps, steps} from './remix'; |
| 7 | +describe('javascript-remix onboarding docs', function () { |
| 8 | + it('renders onboarding docs correctly', () => { |
| 9 | + renderWithOnboardingLayout(docs); |
7 | 10 |
|
8 | | -describe('GettingStartedWithRemix', function () { |
9 | | - it('all products are selected', function () { |
10 | | - render( |
11 | | - <GettingStartedWithRemix |
12 | | - dsn="test-dsn" |
13 | | - projectSlug="test-project" |
14 | | - activeProductSelection={[ |
15 | | - ProductSolution.PERFORMANCE_MONITORING, |
16 | | - ProductSolution.SESSION_REPLAY, |
17 | | - ]} |
18 | | - /> |
19 | | - ); |
| 11 | + // Renders main headings |
| 12 | + expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument(); |
| 13 | + expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument(); |
| 14 | + expect(screen.getByRole('heading', {name: 'Next Steps'})).toBeInTheDocument(); |
20 | 15 |
|
21 | | - // Steps |
22 | | - for (const step of steps()) { |
23 | | - expect( |
24 | | - screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]}) |
25 | | - ).toBeInTheDocument(); |
26 | | - } |
| 16 | + // Includes minimum required Astro version |
| 17 | + expect(screen.getByText(textWithMarkupMatcher(/Remix 1.0.0/))).toBeInTheDocument(); |
27 | 18 |
|
28 | | - // Next Steps |
29 | | - const filteredNextStepsLinks = nextSteps.filter( |
30 | | - nextStep => |
31 | | - ![ |
32 | | - ProductSolution.PERFORMANCE_MONITORING, |
33 | | - ProductSolution.SESSION_REPLAY, |
34 | | - ].includes(nextStep.id as ProductSolution) |
35 | | - ); |
36 | | - |
37 | | - for (const filteredNextStepsLink of filteredNextStepsLinks) { |
38 | | - expect( |
39 | | - screen.getByRole('link', {name: filteredNextStepsLink.name}) |
40 | | - ).toBeInTheDocument(); |
41 | | - } |
| 19 | + // Includes wizard command statement |
| 20 | + expect( |
| 21 | + screen.getByText(textWithMarkupMatcher(/npx @sentry\/wizard@latest -i remix/)) |
| 22 | + ).toBeInTheDocument(); |
42 | 23 | }); |
43 | 24 | }); |
0 commit comments