Skip to content
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

much safer to look for a specific facet type before clicking #81

Open
wants to merge 1 commit into
base: production
Choose a base branch
from

Conversation

chrisFrazier77
Copy link
Contributor

No description provided.

@chrisFrazier77 chrisFrazier77 requested a review from korgon January 25, 2024 19:20
Comment on lines +669 to +678
const listFacet = store.facets.filter((facet) => facet.display === 'list')[0];
if (!listFacet) this.skip();

cy.get(`${config.selectors.sidebar.facetWrapper}`).each((facet) => {
// find matching facet in dom
const title = facet.find(config.selectors.sidebar.facetTitle);
if (listFacet.label.trim() === title.text().trim()) {
if (listFacet.collapsed) {
// toggle visibility if collapsed
listFacet.toggleCollapse();
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this test is testing the "clear all" functionality - if we wanted to simplify this test we could apply a facet via the store to bypass the DOM entirely.

if (listFacet.label.trim() === title.text().trim()) {
if (listFacet.collapsed) {
// toggle visibility if collapsed
listFacet.toggleCollapse();
Copy link
Contributor

@korgon korgon Jan 26, 2024

Choose a reason for hiding this comment

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

May want to add a 1ms delay after toggleCollapse() usage (apparently needed when testing library components)

cy.wait(1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants