@@ -27,8 +27,35 @@ afterEach(() => {
2727} ) ;
2828
2929describe ( "ObjectiveDialogContent" , ( ) => {
30- it ( "renders shared textarea and desktop select trigger primitives with helper text wiring" , ( ) => {
31- render (
30+ it ( "renders a flat supervisor intro strip for enable and edit modes" , ( ) => {
31+ const { rerender } = render (
32+ < ObjectiveDialogContent
33+ mode = "enable"
34+ draftObjective = "Investigate regressions"
35+ draftEvaluatorProviderId = "claude"
36+ draftEvaluatorModel = ""
37+ draftMaxSupervisionCount = "0"
38+ draftScheduledAt = ""
39+ disableObjective = ""
40+ onDraftObjectiveChange = { vi . fn ( ) }
41+ onDraftEvaluatorProviderChange = { vi . fn ( ) }
42+ onDraftEvaluatorModelChange = { vi . fn ( ) }
43+ onDraftMaxSupervisionCountChange = { vi . fn ( ) }
44+ onDraftScheduledAtChange = { vi . fn ( ) }
45+ />
46+ ) ;
47+
48+ let intro = document . querySelector ( ".supervisor-dialog-intro" ) ;
49+ expect ( intro ) . toBeTruthy ( ) ;
50+ expect ( intro ?. querySelector ( '[data-icon-semantic="supervisor.mode.enable"]' ) ) . toBeTruthy ( ) ;
51+ expect ( intro ?. querySelector ( ".supervisor-dialog-intro__title" ) ) . toHaveTextContent (
52+ "supervisor.dialog.enable.title"
53+ ) ;
54+ expect ( intro ?. querySelector ( ".supervisor-dialog-intro__description" ) ) . toHaveTextContent (
55+ "supervisor.dialog.enable.subtitle"
56+ ) ;
57+
58+ rerender (
3259 < ObjectiveDialogContent
3360 mode = "edit"
3461 draftObjective = "Investigate regressions"
@@ -45,8 +72,38 @@ describe("ObjectiveDialogContent", () => {
4572 />
4673 ) ;
4774
75+ intro = document . querySelector ( ".supervisor-dialog-intro" ) ;
76+ expect ( intro ) . toBeTruthy ( ) ;
77+ expect ( intro ?. querySelector ( '[data-icon-semantic="supervisor.mode.edit"]' ) ) . toBeTruthy ( ) ;
78+ expect ( intro ?. querySelector ( ".supervisor-dialog-intro__title" ) ) . toHaveTextContent (
79+ "supervisor.dialog.edit.title"
80+ ) ;
81+ expect ( intro ?. querySelector ( ".supervisor-dialog-intro__description" ) ) . toHaveTextContent (
82+ "supervisor.dialog.edit.subtitle"
83+ ) ;
84+ } ) ;
85+
86+ it ( "renders compact control classes instead of large form controls" , ( ) => {
87+ render (
88+ < ObjectiveDialogContent
89+ mode = "edit"
90+ draftObjective = "Investigate regressions"
91+ draftEvaluatorProviderId = "claude"
92+ draftEvaluatorModel = "sonnet"
93+ draftMaxSupervisionCount = "3"
94+ draftScheduledAt = ""
95+ disableObjective = ""
96+ onDraftObjectiveChange = { vi . fn ( ) }
97+ onDraftEvaluatorProviderChange = { vi . fn ( ) }
98+ onDraftEvaluatorModelChange = { vi . fn ( ) }
99+ onDraftMaxSupervisionCountChange = { vi . fn ( ) }
100+ onDraftScheduledAtChange = { vi . fn ( ) }
101+ />
102+ ) ;
103+
48104 const textarea = screen . getByLabelText ( "supervisor.field.objective" ) ;
49- expect ( textarea ) . toHaveClass ( "input" , "textarea" , "textarea-lg" ) ;
105+ expect ( textarea ) . toHaveClass ( "input" , "textarea" ) ;
106+ expect ( textarea ) . not . toHaveClass ( "textarea-lg" ) ;
50107 expect ( textarea ) . toHaveAttribute ( "rows" , "5" ) ;
51108 expect ( textarea ) . toHaveValue ( "Investigate regressions" ) ;
52109 expect ( textarea ) . toHaveAttribute ( "aria-describedby" ) ;
@@ -58,12 +115,25 @@ describe("ObjectiveDialogContent", () => {
58115 const trigger = screen . getByRole ( "button" , {
59116 name : "supervisor.field.evaluator Claude" ,
60117 } ) ;
61- expect ( trigger ) . toHaveClass ( "input" , "mobile-select-trigger" ) ;
118+ expect ( trigger ) . toHaveClass ( "input" , "mobile-select-trigger" , "input-sm" ) ;
62119 expect ( trigger ) . toHaveAttribute ( "aria-describedby" ) ;
63120 expect ( screen . getByText ( "supervisor.field.evaluator_helper" ) ) . toHaveAttribute (
64121 "id" ,
65122 trigger . getAttribute ( "aria-describedby" )
66123 ) ;
124+
125+ expect ( screen . getByLabelText ( "supervisor.field.evaluator_model" ) ) . toHaveClass (
126+ "input" ,
127+ "input-sm"
128+ ) ;
129+ expect ( screen . getByLabelText ( "supervisor.field.max_supervision_count" ) ) . toHaveClass (
130+ "input" ,
131+ "input-sm"
132+ ) ;
133+ expect ( screen . getByRole ( "button" , { name : "supervisor.field.scheduled_at" } ) ) . toHaveClass (
134+ "input" ,
135+ "input-sm"
136+ ) ;
67137 } ) ;
68138
69139 it ( "keeps objective editing behavior unchanged" , ( ) => {
@@ -222,6 +292,7 @@ describe("ObjectiveDialogContent", () => {
222292 />
223293 ) ;
224294
295+ expect ( document . querySelector ( ".supervisor-dialog-intro" ) ) . toBeNull ( ) ;
225296 expect (
226297 screen . getByRole ( "alert" ) . querySelector ( '[data-icon-semantic="state.warning"]' )
227298 ) . toBeTruthy ( ) ;
0 commit comments