@@ -273,8 +273,9 @@ describe("BreakpointClassNameControl", () => {
273273
274274 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
275275 const baseInput = itemControls [ 0 ] ;
276+ expect ( baseInput ) . toBeDefined ( ) ;
276277
277- fireEvent . change ( baseInput , { target : { value : "w-full p-4" } } ) ;
278+ fireEvent . change ( baseInput ! , { target : { value : "w-full p-4" } } ) ;
278279
279280 await waitFor ( ( ) => {
280281 expect ( mockOnChange ) . toHaveBeenLastCalledWith ( "w-full p-4" ) ;
@@ -287,8 +288,9 @@ describe("BreakpointClassNameControl", () => {
287288
288289 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
289290 const baseInput = itemControls [ 0 ] ;
291+ expect ( baseInput ) . toBeDefined ( ) ;
290292
291- fireEvent . change ( baseInput , { target : { value : "w-full" } } ) ;
293+ fireEvent . change ( baseInput ! , { target : { value : "w-full" } } ) ;
292294
293295 await waitFor ( ( ) => {
294296 expect ( mockOnChange ) . toHaveBeenCalledWith ( "w-full md:w-8" ) ;
@@ -301,8 +303,9 @@ describe("BreakpointClassNameControl", () => {
301303
302304 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
303305 const baseInput = itemControls [ 0 ] ;
306+ expect ( baseInput ) . toBeDefined ( ) ;
304307
305- fireEvent . change ( baseInput , { target : { value : "w-full" } } ) ;
308+ fireEvent . change ( baseInput ! , { target : { value : "w-full" } } ) ;
306309
307310 await waitFor ( ( ) => {
308311 expect ( mockOnChange ) . toHaveBeenCalledWith ( "w-full lg:w-12 sm:w-2" ) ;
@@ -317,8 +320,9 @@ describe("BreakpointClassNameControl", () => {
317320
318321 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
319322 const mdInput = itemControls [ 1 ] ;
323+ expect ( mdInput ) . toBeDefined ( ) ;
320324
321- fireEvent . change ( mdInput , { target : { value : "w-8 h-8" } } ) ;
325+ fireEvent . change ( mdInput ! , { target : { value : "w-8 h-8" } } ) ;
322326
323327 await waitFor ( ( ) => {
324328 expect ( mockOnChange ) . toHaveBeenLastCalledWith ( "md:w-8 md:h-8" ) ;
@@ -331,8 +335,9 @@ describe("BreakpointClassNameControl", () => {
331335
332336 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
333337 const mdInput = itemControls [ 1 ] ;
338+ expect ( mdInput ) . toBeDefined ( ) ;
334339
335- fireEvent . change ( mdInput , { target : { value : "w-8" } } ) ;
340+ fireEvent . change ( mdInput ! , { target : { value : "w-8" } } ) ;
336341
337342 await waitFor ( ( ) => {
338343 expect ( mockOnChange ) . toHaveBeenCalledWith ( "w-full p-4 md:w-8" ) ;
@@ -345,8 +350,9 @@ describe("BreakpointClassNameControl", () => {
345350
346351 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
347352 const mdInput = itemControls [ 1 ] ;
353+ expect ( mdInput ) . toBeDefined ( ) ;
348354
349- fireEvent . change ( mdInput , { target : { value : "w-8" } } ) ;
355+ fireEvent . change ( mdInput ! , { target : { value : "w-8" } } ) ;
350356
351357 await waitFor ( ( ) => {
352358 expect ( mockOnChange ) . toHaveBeenCalledWith ( "w-full md:w-8 lg:w-12 sm:w-2" ) ;
@@ -359,8 +365,9 @@ describe("BreakpointClassNameControl", () => {
359365
360366 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
361367 const mdInput = itemControls [ 1 ] ;
368+ expect ( mdInput ) . toBeDefined ( ) ;
362369
363- fireEvent . change ( mdInput , { target : { value : "" } } ) ;
370+ fireEvent . change ( mdInput ! , { target : { value : "" } } ) ;
364371
365372 await waitFor ( ( ) => {
366373 expect ( mockOnChange ) . toHaveBeenCalledWith ( "w-full" ) ;
@@ -425,8 +432,10 @@ describe("BreakpointClassNameControl", () => {
425432 render ( < BreakpointClassNameControl value = "" onChange = { mockOnChange } /> ) ;
426433
427434 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
428- fireEvent . change ( itemControls [ 0 ] , { target : { value : "w-full p-4" } } ) ;
429- fireEvent . change ( itemControls [ 1 ] , { target : { value : "w-8 h-8" } } ) ;
435+ expect ( itemControls [ 0 ] ) . toBeDefined ( ) ;
436+ expect ( itemControls [ 1 ] ) . toBeDefined ( ) ;
437+ fireEvent . change ( itemControls [ 0 ] ! , { target : { value : "w-full p-4" } } ) ;
438+ fireEvent . change ( itemControls [ 1 ] ! , { target : { value : "w-8 h-8" } } ) ;
430439
431440 await waitFor ( ( ) => {
432441 // Should normalize spaces
@@ -439,7 +448,8 @@ describe("BreakpointClassNameControl", () => {
439448 render ( < BreakpointClassNameControl value = "lg:w-12" onChange = { mockOnChange } /> ) ;
440449
441450 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
442- fireEvent . change ( itemControls [ 0 ] , { target : { value : "w-full" } } ) ;
451+ expect ( itemControls [ 0 ] ) . toBeDefined ( ) ;
452+ fireEvent . change ( itemControls [ 0 ] ! , { target : { value : "w-full" } } ) ;
443453
444454 await waitFor ( ( ) => {
445455 expect ( mockOnChange ) . toHaveBeenLastCalledWith ( "w-full lg:w-12" ) ;
@@ -505,12 +515,14 @@ describe("BreakpointClassNameControl", () => {
505515
506516 // Start with base tab
507517 const itemControls = screen . getAllByTestId ( "item-control-input" ) ;
508- fireEvent . change ( itemControls [ 0 ] , { target : { value : "p-4" } } ) ;
518+ expect ( itemControls [ 0 ] ) . toBeDefined ( ) ;
519+ expect ( itemControls [ 1 ] ) . toBeDefined ( ) ;
520+ fireEvent . change ( itemControls [ 0 ] ! , { target : { value : "p-4" } } ) ;
509521
510522 // Switch to md tab
511523 const mdTrigger = screen . getByTestId ( "md-tab-trigger" ) ;
512524 await user . click ( mdTrigger ) ;
513- fireEvent . change ( itemControls [ 1 ] , { target : { value : "p-8" } } ) ;
525+ fireEvent . change ( itemControls [ 1 ] ! , { target : { value : "p-8" } } ) ;
514526
515527 // Use multiselect to add more classes
516528 const multiselectInput = screen . getByTestId ( "multiselect-input" ) ;
0 commit comments