Skip to content

test(input-date-picker): add test for no longer closing date-picker when using arrow and page keys. #9097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

anveshmekala
Copy link
Contributor

@anveshmekala anveshmekala commented Apr 9, 2024

Related Issue: #9082

Summary

No longer closes date-picker in input-date-picker when user interacts with arrowKeys (arrowDown/arrowUp) or pageKeys (pageUp/pageDown).

Base automatically changed from anveshmekala/9062-fix-date-picker-arrow-key-focus to main April 10, 2024 19:35
@anveshmekala anveshmekala added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 10, 2024
@anveshmekala
Copy link
Contributor Author

anveshmekala commented Apr 10, 2024

should the PR title use test or fix considering the issue is resolved in date-picker with PR #9063. We can use #9082 to verify the fix for input-date-picker

@anveshmekala anveshmekala marked this pull request as ready for review April 10, 2024 22:29
@anveshmekala anveshmekala requested a review from a team as a code owner April 10, 2024 22:29
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 10, 2024
@driskull
Copy link
Member

@anveshmekala I'm only seeing changes to a test in this PR.

@driskull
Copy link
Member

should the PR title use test or fix considering the issue is resolved in date-picker with PR #9063. We can use #9082 to verify the fix for input-date-picker

Yes, it should use test(input-date-picker)

@anveshmekala anveshmekala changed the title fix(input-date-picker): no longer closes date-picker when using arrow and page keys. test(input-date-picker): no longer closes date-picker when using arrow and page keys. Apr 10, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anveshmekala Looking good!


await page.keyboard.press("PageDown");
await page.waitForChanges();
calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This selector is used frequently, can you store it in a local variable and reuse?

await page.keyboard.press("Enter");
await page.waitForChanges();
calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`);
expect(await calendar.isVisible()).toBe(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add finer-grained assertions on the month navigation? It looks like this is only asserting that the calendar is displayed. Applies to the test below.

await page.waitForChanges();
calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`);
expect(await calendar.isVisible()).toBe(false);
expect(await inputDatePicker.getProperty("value")).not.toEqual(["2024-01-01", "2024-02-10"]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, can you assert on the actual values instead? Assertion-wise, this and the assertion on L1237 would pass if they are the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense.

@anveshmekala anveshmekala requested a review from jcfranco April 16, 2024 22:07
@anveshmekala anveshmekala added skip visual snapshots Pull requests that do not need visual regression testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 16, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Apr 26, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐️⭐️⭐️⭐️⭐️

Reviewed on 4/26/2024

Awesome! Would review again!

@jcfranco jcfranco changed the title test(input-date-picker): no longer closes date-picker when using arrow and page keys. test(input-date-picker): add test for no longer closing date-picker when using arrow and page keys. Apr 27, 2024
@anveshmekala anveshmekala merged commit 1201138 into main Apr 29, 2024
@anveshmekala anveshmekala deleted the anveshmekala/9082-fix-input-date-picker-arrow-and-page-keys branch April 29, 2024 15:03
@github-actions github-actions bot added this to the 2024-04-30 - Apr Release milestone Apr 29, 2024
benelan added a commit that referenced this pull request Apr 29, 2024
…ustom-event

* origin/main:
  fix(chip-group): Improve programmatic Chip selection behavior (#9213)
  test(input-date-picker): add test for no longer closing date-picker when using arrow and page keys. (#9097)
  build(deps): update actions/setup-node action to v4 (#9143)
  ci: adds support to test issue template priority status (#9192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. skip visual snapshots Pull requests that do not need visual regression testing. Stale Issues or pull requests that have not had recent activity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants