@@ -177,3 +177,78 @@ test('ReactUnipika: with error', async ({mount, expectScreenshot, page}) => {
177177
178178 await expectScreenshot ( { component : page } ) ;
179179} ) ;
180+
181+ test ( 'ReactUnipika: with case insensitive search with matches' , async ( {
182+ mount,
183+ expectScreenshot,
184+ page,
185+ } ) => {
186+ await mount ( < Stories . WithCaseInsensitiveSearch /> , { width : 1280 } ) ;
187+
188+ await page . getByTestId ( 'qa:structuredyson:search' ) . locator ( 'input' ) . fill ( 'Attr' ) ;
189+
190+ await expectScreenshot ( { component : page } ) ;
191+ } ) ;
192+
193+ test ( 'ReactUnipika: with case insensitive search with matches 2' , async ( {
194+ mount,
195+ expectScreenshot,
196+ page,
197+ } ) => {
198+ await mount ( < Stories . WithCaseInsensitiveSearch /> , { width : 1280 } ) ;
199+
200+ await page . getByTestId ( 'qa:structuredyson:search' ) . locator ( 'input' ) . fill ( 'attr' ) ;
201+
202+ await expectScreenshot ( { component : page } ) ;
203+ } ) ;
204+
205+ test ( 'ReactUnipika: with case insensitive search toggle' , async ( { mount, page} ) => {
206+ await mount ( < Stories . WithCaseInsensitiveSearch /> , { width : 1280 } ) ;
207+
208+ await page . getByTestId ( 'qa:structuredyson:search' ) . locator ( 'input' ) . fill ( 'Type_1' ) ;
209+
210+ const visibleHighlightedElements = await page
211+ . locator ( '.g-ru-cell__filtered_highlighted:has-text("type_1")' )
212+ . filter ( { hasText : 'Type_1' } )
213+ . count ( ) ;
214+ if ( visibleHighlightedElements !== 1 ) {
215+ throw new Error (
216+ `Expected 1 visible highlighted elements with "Type_1", but found ${ visibleHighlightedElements } ` ,
217+ ) ;
218+ }
219+
220+ await page . getByTestId ( 'qa:case-sensitive-button' ) . click ( ) ;
221+ const newVisibleHighlightedElements = await page
222+ . locator ( '.g-ru-cell__filtered_highlighted:has-text("type_1")' )
223+ . filter ( { hasText : 'Type_1' } )
224+ . count ( ) ;
225+ if ( newVisibleHighlightedElements !== 0 ) {
226+ throw new Error (
227+ `Expected 0 visible highlighted elements with "Type_1", but found ${ visibleHighlightedElements } ` ,
228+ ) ;
229+ }
230+ } ) ;
231+
232+ test ( 'ReactUnipika: with case sensitive search no matches' , async ( {
233+ mount,
234+ expectScreenshot,
235+ page,
236+ } ) => {
237+ await mount ( < Stories . Json /> , { width : 1280 } ) ;
238+
239+ await page . getByTestId ( 'qa:structuredyson:search' ) . locator ( 'input' ) . fill ( 'Attr' ) ;
240+
241+ await expectScreenshot ( { component : page } ) ;
242+ } ) ;
243+
244+ test ( 'ReactUnipika: with case sensitive search with matches' , async ( {
245+ mount,
246+ expectScreenshot,
247+ page,
248+ } ) => {
249+ await mount ( < Stories . Json /> , { width : 1280 } ) ;
250+
251+ await page . getByTestId ( 'qa:structuredyson:search' ) . locator ( 'input' ) . fill ( 'attr' ) ;
252+
253+ await expectScreenshot ( { component : page } ) ;
254+ } ) ;
0 commit comments