Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions static/app/views/prevent/preventAI/onboarding.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('PreventAIOnboarding', () => {
).toBeInTheDocument();
});

it('renders all three onboarding steps', () => {
it('renders both onboarding steps', () => {
render(<PreventAIOnboarding />, {organization});

expect(screen.getByText('1')).toBeInTheDocument();
Expand All @@ -78,9 +78,6 @@ describe('PreventAIOnboarding', () => {
expect(
screen.getByRole('heading', {name: 'Setup GitHub Integration'})
).toBeInTheDocument();

expect(screen.getByText('3')).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Setup Seer'})).toBeInTheDocument();
});

it('renders external links with correct hrefs', async () => {
Expand Down Expand Up @@ -120,14 +117,6 @@ describe('PreventAIOnboarding', () => {
{organization}
);

const seerLink = screen.getByRole('link', {name: 'Seer by Sentry GitHub App'});
expect(seerLink).toHaveAttribute('href', 'https://github.com/apps/seer-by-sentry');
await userEvent.click(seerLink);
expect(trackAnalytics).toHaveBeenCalledWith(
'prevent.ai_onboarding.seer_app_link.clicked',
{organization}
);

const learnMoreLink = screen.getByRole('link', {name: 'Learn more'});
expect(learnMoreLink).toHaveAttribute(
'href',
Expand Down Expand Up @@ -210,11 +199,10 @@ describe('PreventAIOnboarding', () => {
render(<PreventAIOnboarding />, {organization});

const stepHeadings = screen.getAllByRole('heading', {level: 3});
expect(stepHeadings).toHaveLength(3);
expect(stepHeadings).toHaveLength(2);

expect(stepHeadings[0]).toHaveTextContent('Enable AI Code Review features');
expect(stepHeadings[1]).toHaveTextContent('Setup GitHub Integration');
expect(stepHeadings[2]).toHaveTextContent('Setup Seer');
});

describe('step descriptions', () => {
Expand Down Expand Up @@ -251,19 +239,7 @@ describe('PreventAIOnboarding', () => {
expect(
screen.getByText(
textWithMarkupMatcher(
'To grant Seer access to your codebase, install the Sentry GitHub App to connect your GitHub repositories. Learn more about GitHub integration.'
)
)
).toBeInTheDocument();
});

it('renders step 3 description with Seer app link', () => {
render(<PreventAIOnboarding />, {organization});

expect(
screen.getByText(
textWithMarkupMatcher(
'AI Code Review uses the Sentry Seer agent to power its core functionalities. Install the Seer by Sentry GitHub App within the same GitHub organization.'
'Install the Sentry GitHub App to connect your GitHub repositories and enable AI Code Review to access your codebase. Learn more about GitHub integration.'
)
)
).toBeInTheDocument();
Expand Down
23 changes: 2 additions & 21 deletions static/app/views/prevent/preventAI/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function OnboardingStep({step, title, description}: OnboardingStepProps) {
return (
<Flex gap="md" align="start" position="relative">
<StepNumber>{step}</StepNumber>
<StepContent isLastStep={step === 3}>
<StepContent isLastStep={step === 2}>
<Flex direction="column" gap="md">
<Heading as="h3">{title}</Heading>
<Text variant="muted" size="md">
Expand Down Expand Up @@ -205,7 +205,7 @@ export default function PreventAIOnboarding() {
step={2}
title={t(`Setup GitHub Integration`)}
description={tct(
'To grant Seer access to your codebase, install the [sentryGitHubApp:Sentry GitHub App] to connect your GitHub repositories. Learn more about [gitHubIntegration:GitHub integration].',
'Install the [sentryGitHubApp:Sentry GitHub App] to connect your GitHub repositories and enable AI Code Review to access your codebase. Learn more about [gitHubIntegration:GitHub integration].',
{
sentryGitHubApp: (
<Link
Expand Down Expand Up @@ -233,25 +233,6 @@ export default function PreventAIOnboarding() {
}
)}
/>
<OnboardingStep
step={3}
title={t(`Setup Seer`)}
description={tct(
'AI Code Review uses the Sentry Seer agent to power its core functionalities. Install the [link:Seer by Sentry GitHub App] within the same GitHub organization.',
{
link: (
<ExternalLink
href="https://github.com/apps/seer-by-sentry"
onClick={() => {
trackAnalytics('prevent.ai_onboarding.seer_app_link.clicked', {
organization,
});
}}
/>
),
}
)}
/>
</Flex>
<FeatureOverview />
<Text variant="muted" size="xs">
Expand Down
Loading