@@ -75,7 +75,7 @@ describe('ExamplesContent', () => {
7575 } ) ;
7676
7777 it ( 'filters examples based on product filter selection' , ( ) => {
78- // Make the screen wider than the default of 1024px as desktop filtering only works >= 1040px
78+ // Desktop filter auto-commits at the `sm` breakpoint (768px) and above
7979 Object . defineProperty ( window , 'innerWidth' , { writable : true , configurable : true , value : 1600 } ) ;
8080 window . dispatchEvent ( new Event ( 'resize' ) ) ;
8181
@@ -86,4 +86,19 @@ describe('ExamplesContent', () => {
8686 expect ( screen . queryByText ( 'Online status' ) ) . not . toBeInTheDocument ( ) ;
8787 expect ( screen . getByText ( 'Member location' ) ) . toBeInTheDocument ( ) ;
8888 } ) ;
89+
90+ // DX-1449: between the `sm` (768px) and `md` (1040px) breakpoints the inline
91+ // desktop filter renders without an Apply button, but selections previously
92+ // only committed at >= 1040px, leaving the filter inert in that range.
93+ it ( 'filters examples at widths between the sm and md breakpoints' , ( ) => {
94+ Object . defineProperty ( window , 'innerWidth' , { writable : true , configurable : true , value : 818 } ) ;
95+ window . dispatchEvent ( new Event ( 'resize' ) ) ;
96+
97+ render ( < ExamplesContent exampleImages = { exampleImages } /> ) ;
98+ const productFilterInput = screen . getByTestId ( 'product-spaces' ) ;
99+ fireEvent . click ( productFilterInput ) ;
100+
101+ expect ( screen . queryByText ( 'Online status' ) ) . not . toBeInTheDocument ( ) ;
102+ expect ( screen . getByText ( 'Member location' ) ) . toBeInTheDocument ( ) ;
103+ } ) ;
89104} ) ;
0 commit comments