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
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ describe('NewCronDetectorForm', () => {
renderForm();

// Form sections should be visible
expect(await screen.findByText(/Detect/)).toBeInTheDocument();
expect(screen.getByText(/Issue Ownership/)).toBeInTheDocument();
expect(await screen.findByTestId('form-sections')).toBeVisible();

// Create Monitor button should be present and enabled
const createButton = screen.getByRole('button', {name: 'Create Monitor'});
Expand All @@ -78,8 +77,7 @@ describe('NewCronDetectorForm', () => {
await screen.findByText('Step 2 of 2');

// Form sections should be hidden
expect(screen.queryByText(/Detect/)).not.toBeInTheDocument();
expect(screen.queryByText(/Issue Ownership/)).not.toBeInTheDocument();
expect(screen.getByTestId('form-sections')).not.toBeVisible();

// Create Monitor button should be present but disabled
const createButton = screen.getByRole('button', {name: 'Create Monitor'});
Expand Down
35 changes: 17 additions & 18 deletions static/app/views/detectors/components/forms/cron/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {Fragment} from 'react';
import {useTheme} from '@emotion/react';

import {Alert} from '@sentry/scraps/alert';
Expand Down Expand Up @@ -43,26 +42,26 @@ function CronDetectorForm({detector}: {detector?: CronDetector}) {
const theme = useTheme();
const showingPlatformGuide = useIsShowingPlatformGuide();

const formSections = (
<Fragment>
{dataSource?.queryObj.isUpserting && (
<Alert variant="warning">
{t(
'This monitor is managed in code and updates automatically with each check-in. Changes made here may be overwritten!'
)}
</Alert>
)}
<PreviewSection />
{FORM_SECTIONS.map((FormSection, index) => (
<FormSection key={index} step={index + 1} />
))}
</Fragment>
);

return (
<Stack gap="2xl" maxWidth={theme.breakpoints.xl}>
{!detector && <InstrumentationGuide />}
{!showingPlatformGuide && formSections}
<Stack
data-test-id="form-sections"
style={showingPlatformGuide ? {display: 'none'} : undefined}
Comment thread
malwilley marked this conversation as resolved.
gap="2xl"
>
{dataSource?.queryObj.isUpserting && (
<Alert variant="warning">
{t(
'This monitor is managed in code and updates automatically with each check-in. Changes made here may be overwritten!'
)}
</Alert>
)}
<PreviewSection />
{FORM_SECTIONS.map((FormSection, index) => (
<FormSection key={index} step={index + 1} />
))}
</Stack>
</Stack>
);
}
Expand Down
Loading