Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Improve e2e tests #840

Merged
merged 6 commits into from
Feb 11, 2022
Merged

Improve e2e tests #840

merged 6 commits into from
Feb 11, 2022

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Feb 9, 2022

Fixes

Related #797 by @sarayourfriend

Description

While working on the #835 solution, I saw a bug when the filters were not reset correctly when changing the content type, so I added the e2e tests that would catch this problem. While at it, I also quickly refactored the e2e tests to extract some often-used functions, and enabled some tests that were set to skip before.
E2e tests will be very important when converting to Pinia.

Testing Instructions

Run pnpm e2e:ci. This should build the app and run e2e tests. Only 2 tests should be skipped, others should pass.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Feb 9, 2022
@obulat obulat requested a review from a team as a code owner February 9, 2022 13:44
@obulat obulat self-assigned this Feb 9, 2022
@obulat obulat requested review from zackkrida and dhruvkb February 9, 2022 13:44
Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

LGTM! Love the clean up and the new tests 🎉

Comment on lines +12 to +16
aria-controls="content-switcher-popover"
/>
</template>
<VContentTypes
id="content-switcher-popover"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohhh interesting! I missed this requirement.

I wonder if there's a good way to remove the need to duplicate this prop value and also add a warning that it should be included (similar to the aria-label/aria-labelledby prop) 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a sign of another a11y problem a good idea. To be honest, I've read about aria-controls and aria-haspopup, and still don't understand whether it should be dialog or menu, and whether aria-controls is strictly necessary, @sarayourfriend .
I added it here because I couldn't find a better more accessible way of selecting the content switcher in e2e tests (the text changes, so I can't use it). And this might bea sign of another a11y problem

Copy link
Contributor

Choose a reason for hiding this comment

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

I also was confused about that but looking at Reakit, as I often do to check on ideas for how to implement some of these patterns correctly, it does include aria-controls in the Disclosure component which is used for Dialog as well in DialogDisclosure. So I think you're right to add it.

@obulat obulat requested a review from krysal February 10, 2022 14:14
test/e2e/utils.js Outdated Show resolved Hide resolved
Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

Love the changeContentType helper. LGTM!

@obulat obulat merged commit 26af972 into main Feb 11, 2022
@obulat obulat deleted the improve_e2e_tests branch February 11, 2022 13:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants