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

fix(atomic): made facet values focus when pressing show more/show less #2043

Merged
merged 7 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions packages/atomic-angular/projects/atomic-angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 32 additions & 32 deletions packages/atomic-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ export function assertDisplayAllCategoriesButton(display: boolean) {
});
}

export function assertFocusFirstChildValue() {
it('should focus on the first value', () => {
CategoryFacetSelectors.childValue().first().should('be.focused');
});
}

export function assertFocusActiveParent() {
it('should focus on the active parent', () => {
CategoryFacetSelectors.activeParentValue().should('be.focused');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ describe('Category Facet Test Suites', () => {
CategoryFacetSelectors,
true
);
CommonFacetAssertions.assertFocusShowLess(CategoryFacetSelectors);
CategoryFacetAssertions.assertFocusFirstChildValue();
});

describe('verify analytics', () => {
Expand All @@ -412,7 +412,7 @@ describe('Category Facet Test Suites', () => {
CategoryFacetSelectors,
false
);
CommonFacetAssertions.assertFocusShowMore(CategoryFacetSelectors);
CategoryFacetAssertions.assertFocusFirstChildValue();
});

describe('verify analytics', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('Color Facet Test Suites', () => {
ColorFacetAssertions.assertNumberOfIdleBoxValues(
colorFacetDefaultNumberOfValues * 2
);
CommonFacetAssertions.assertFocusShowMore(ColorFacetSelectors);
CommonFacetAssertions.assertFocusFirstBoxValue(ColorFacetSelectors);
});
describe('verify analytics', () => {
before(setupSelectShowMore);
Expand Down Expand Up @@ -258,7 +258,7 @@ describe('Color Facet Test Suites', () => {
ColorFacetSelectors,
true
);
CommonFacetAssertions.assertFocusShowLess(ColorFacetSelectors);
CommonFacetAssertions.assertFocusFirstBoxValue(ColorFacetSelectors);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export interface FacetWithLinkSelector extends ComponentSelector {
idleLinkValueLabel: () => Cypress.Chainable<JQuery<HTMLElement>>;
}

export interface FacetWithBoxSelector extends ComponentSelector {
selectedBoxValue: () => Cypress.Chainable<JQuery<HTMLElement>>;
idleBoxValue: () => Cypress.Chainable<JQuery<HTMLElement>>;
boxValueWithText: (text: string) => Cypress.Chainable<JQuery<HTMLElement>>;
idleBoxValueLabel: () => Cypress.Chainable<JQuery<HTMLElement>>;
}

export interface FacetWithSearchSelector extends ComponentSelector {
searchInput: () => Cypress.Chainable<JQuery<HTMLElement>>;
searchClearButton: () => Cypress.Chainable<JQuery<HTMLElement>>;
Expand Down Expand Up @@ -287,18 +294,20 @@ export function assertFocusHeader(BaseFacetSelector: BaseFacetSelector) {
});
}

export function assertFocusShowMore(
FacetWithShowMoreLessSelector: FacetWithShowMoreLessSelector
export function assertFocusFirstCheckboxValue(
FacetWithShowMoreLessSelector: FacetWithCheckboxSelector
) {
it('should focus on the show more button', () => {
FacetWithShowMoreLessSelector.showMoreButton().should('be.focused');
it('should focus on the first value', () => {
FacetWithShowMoreLessSelector.idleCheckboxValue()
.first()
.should('be.focused');
});
}

export function assertFocusShowLess(
FacetWithShowMoreLessSelector: FacetWithShowMoreLessSelector
export function assertFocusFirstBoxValue(
FacetWithShowMoreLessSelector: FacetWithBoxSelector
) {
it('should focus on the show less button', () => {
FacetWithShowMoreLessSelector.showLessButton().should('be.focused');
it('should focus on the first value', () => {
FacetWithShowMoreLessSelector.idleBoxValue().first().should('be.focused');
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ describe('Facet v1 Test Suites', () => {
FacetSelectors,
defaultNumberOfValues * 2
);
CommonFacetAssertions.assertFocusShowMore(FacetSelectors);
CommonFacetAssertions.assertFocusFirstCheckboxValue(FacetSelectors);
});

describe('verify analytics', () => {
Expand All @@ -689,7 +689,7 @@ describe('Facet v1 Test Suites', () => {
false
);
CommonFacetAssertions.assertDisplayShowLessButton(FacetSelectors, true);
CommonFacetAssertions.assertFocusShowLess(FacetSelectors);
CommonFacetAssertions.assertFocusFirstCheckboxValue(FacetSelectors);
});
});

Expand Down
Loading