@@ -270,39 +270,6 @@ configs().forEach(({ title, screenshot, config }) => {
270270 const datetime = page . locator ( 'ion-datetime' ) ;
271271 await expect ( datetime ) . toHaveScreenshot ( screenshot ( `datetime-footer-custom-buttons` ) ) ;
272272 } ) ;
273- test ( 'should only have one active month option after changing month twice' , async ( { page } ) => {
274- await page . setContent (
275- `
276- <ion-datetime value="2022-05-03"></ion-datetime>
277- ` ,
278- config
279- ) ;
280-
281- await page . locator ( '.datetime-ready' ) . waitFor ( ) ;
282-
283- const nextMonthButton = page . locator ( 'ion-datetime .calendar-next-prev ion-button' ) . nth ( 1 ) ;
284- const monthYearButton = page . locator ( 'ion-datetime .calendar-month-year' ) ;
285-
286- await monthYearButton . click ( ) ;
287- await page . waitForChanges ( ) ;
288- await monthYearButton . click ( ) ;
289- await page . waitForChanges ( ) ;
290- await nextMonthButton . click ( ) ;
291- await page . waitForChanges ( ) ;
292- await page . waitForTimeout ( 2000 ) ;
293- await monthYearButton . click ( ) ;
294- await page . waitForChanges ( ) ;
295- await monthYearButton . click ( ) ;
296- await page . waitForChanges ( ) ;
297- await nextMonthButton . click ( ) ;
298- await page . waitForChanges ( ) ;
299- await page . waitForTimeout ( 2000 ) ;
300- await monthYearButton . click ( ) ;
301- await page . waitForChanges ( ) ;
302-
303- const selectedMonthOptions = page . locator ( '.month-column ion-picker-column-option.option-active' ) ;
304- await expect ( selectedMonthOptions ) . toHaveCount ( 1 ) ;
305- } ) ;
306273 } ) ;
307274} ) ;
308275
@@ -382,6 +349,40 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
382349 } ) ;
383350} ) ;
384351
352+ /**
353+ * This behavior does not differ across
354+ * modes/directions.
355+ */
356+ configs ( { modes : [ 'md' ] , directions : [ 'ltr' ] } ) . forEach ( ( { config } ) => {
357+ test ( 'datetime: month picker selection' , async ( { page } ) => {
358+ await page . setContent (
359+ `
360+ <ion-datetime value="2022-05-03"></ion-datetime>
361+ ` ,
362+ config
363+ ) ;
364+
365+ await page . locator ( '.datetime-ready' ) . waitFor ( ) ;
366+
367+ const nextMonthButton = page . locator ( 'ion-datetime .calendar-next-prev ion-button' ) . nth ( 1 ) ;
368+ const monthYearButton = page . locator ( 'ion-datetime .calendar-month-year' ) ;
369+
370+ await expect ( monthYearButton ) . toHaveText ( / M a y 2 0 2 2 / ) ;
371+
372+ await nextMonthButton . click ( ) ;
373+ await expect ( monthYearButton ) . toHaveText ( / J u n e 2 0 2 2 / ) ;
374+
375+ await nextMonthButton . click ( ) ;
376+ await expect ( monthYearButton ) . toHaveText ( / J u l y 2 0 2 2 / ) ;
377+
378+ await monthYearButton . click ( ) ;
379+ await page . waitForChanges ( ) ;
380+
381+ const selectedMonthOptions = page . locator ( '.month-column ion-picker-column-option.option-active' ) ;
382+ await expect ( selectedMonthOptions ) . toHaveCount ( 1 ) ;
383+ } ) ;
384+ } ) ;
385+
385386/**
386387 * This behavior does not differ across
387388 * modes/directions.
0 commit comments