Skip to content

Combobox Datepicker Example: test broken on some days #2268

@howard-e

Description

@howard-e

It seems there's an edge case not covered by the tests where if the day of the current month doesn't exist in the previous month, it returns to the 1st of the current month (+ additional offset in the case of March, see other failing cases below) when the previous month button is used.

The following error is currently being reported:

not ok 92 - combobox_datepicker › combobox/combobox-datepicker.html [data-test-id="month-year-button-space-return"]: ENTER on previous year or month and SPACE on next year or month changes the year or month
---
    name: AssertionError
    message: >-
      After sending ENTER on the "previous month" button, the month and year text
      should be not be March 2022
    assertion: not
    values:
      'Value is the same as:': '''March 2022'''
    at: 'test/tests/combobox_datepicker.js:449:9'
  ...

A passing case:

  1. Ensure Mar 28 is selected and open date picker
  2. Navigate to previous month button and select
  3. Result is Feb 28, since Feb 28 exists.

A failing case:

  1. Ensure Mar 29 is selected and open date picker
  2. Navigate to previous month button and select
  3. Result is Mar 1, since no Feb 29 (in 2022).

Other failing cases (examples, not all are listed):

  1. Assume Mar 30 selected > open date picker > navigate to previous month button and select > Mar 2, since no Feb 30.
  2. Assume Mar 31 selected > open date picker > navigate to previous month button and select > Mar 3, since no Feb 31.
  3. Assume Dec 31 selected > open date picker > navigate to previous month button and select > Dec 1, since no Nov 31.

Noticed in #2263 (comment) with suggestion #2263 (comment)

... pin to specific months (plus add some of those specific cases you mentioned) instead of relying on the current month

Metadata

Metadata

Assignees

No one assigned

    Labels

    regression-testingRelated to AVA regression tests of example pages or AVA framework implementation within repo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions