File tree Expand file tree Collapse file tree 2 files changed +19
-22
lines changed
static/app/views/detectors/components/forms/cron Expand file tree Collapse file tree 2 files changed +19
-22
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,7 @@ describe('NewCronDetectorForm', () => {
5757 renderForm ( ) ;
5858
5959 // Form sections should be visible
60- expect ( await screen . findByText ( / D e t e c t / ) ) . toBeInTheDocument ( ) ;
61- expect ( screen . getByText ( / I s s u e O w n e r s h i p / ) ) . toBeInTheDocument ( ) ;
60+ expect ( await screen . findByTestId ( 'form-sections' ) ) . toBeVisible ( ) ;
6261
6362 // Create Monitor button should be present and enabled
6463 const createButton = screen . getByRole ( 'button' , { name : 'Create Monitor' } ) ;
@@ -78,8 +77,7 @@ describe('NewCronDetectorForm', () => {
7877 await screen . findByText ( 'Step 2 of 2' ) ;
7978
8079 // Form sections should be hidden
81- expect ( screen . queryByText ( / D e t e c t / ) ) . not . toBeInTheDocument ( ) ;
82- expect ( screen . queryByText ( / I s s u e O w n e r s h i p / ) ) . not . toBeInTheDocument ( ) ;
80+ expect ( screen . getByTestId ( 'form-sections' ) ) . not . toBeVisible ( ) ;
8381
8482 // Create Monitor button should be present but disabled
8583 const createButton = screen . getByRole ( 'button' , { name : 'Create Monitor' } ) ;
Original file line number Diff line number Diff line change 1- import { Fragment } from 'react' ;
21import { useTheme } from '@emotion/react' ;
32
43import { Alert } from '@sentry/scraps/alert' ;
@@ -43,26 +42,26 @@ function CronDetectorForm({detector}: {detector?: CronDetector}) {
4342 const theme = useTheme ( ) ;
4443 const showingPlatformGuide = useIsShowingPlatformGuide ( ) ;
4544
46- const formSections = (
47- < Fragment >
48- { dataSource ?. queryObj . isUpserting && (
49- < Alert variant = "warning" >
50- { t (
51- 'This monitor is managed in code and updates automatically with each check-in. Changes made here may be overwritten!'
52- ) }
53- </ Alert >
54- ) }
55- < PreviewSection />
56- { FORM_SECTIONS . map ( ( FormSection , index ) => (
57- < FormSection key = { index } step = { index + 1 } />
58- ) ) }
59- </ Fragment >
60- ) ;
61-
6245 return (
6346 < Stack gap = "2xl" maxWidth = { theme . breakpoints . xl } >
6447 { ! detector && < InstrumentationGuide /> }
65- { ! showingPlatformGuide && formSections }
48+ < Stack
49+ data-test-id = "form-sections"
50+ style = { showingPlatformGuide ? { display : 'none' } : undefined }
51+ gap = "2xl"
52+ >
53+ { dataSource ?. queryObj . isUpserting && (
54+ < Alert variant = "warning" >
55+ { t (
56+ 'This monitor is managed in code and updates automatically with each check-in. Changes made here may be overwritten!'
57+ ) }
58+ </ Alert >
59+ ) }
60+ < PreviewSection />
61+ { FORM_SECTIONS . map ( ( FormSection , index ) => (
62+ < FormSection key = { index } step = { index + 1 } />
63+ ) ) }
64+ </ Stack >
6665 </ Stack >
6766 ) ;
6867}
You can’t perform that action at this time.
0 commit comments