diff --git a/packages/atomic/cypress/e2e/facets/color-facet/color-facet.cypress.ts b/packages/atomic/cypress/e2e/facets/color-facet/color-facet.cypress.ts index 6aa03d46f8c..d591913c47e 100644 --- a/packages/atomic/cypress/e2e/facets/color-facet/color-facet.cypress.ts +++ b/packages/atomic/cypress/e2e/facets/color-facet/color-facet.cypress.ts @@ -61,65 +61,6 @@ describe('Color Facet Test Suites', () => { CommonFacetAssertions.assertDisplaySearchInput(ColorFacetSelectors, true); }); - describe('when searching for a value that returns results', () => { - const query = 'html'; - function setupSearchFor() { - typeFacetSearchQuery(ColorFacetSelectors, query, true); - } - - beforeEach(setupSearchFor); - describe('verify rendering', () => { - CommonAssertions.assertAccessibility(colorFacetComponent); - ColorFacetAssertions.assertNumberOfIdleBoxValues(1); - CommonFacetAssertions.assertDisplaySearchClearButton( - ColorFacetSelectors, - true - ); - CommonFacetAssertions.assertHighlightsResults( - ColorFacetSelectors, - query - ); - }); - - describe('when selecting a search result', () => { - function setupSelectSearchResult() { - AnalyticsTracker.reset(); - selectIdleBoxValueAt(0); - } - - beforeEach(setupSelectSearchResult); - describe('verify rendering', () => { - ColorFacetAssertions.assertNumberOfSelectedBoxValues(1); - ColorFacetAssertions.assertNumberOfIdleBoxValues( - colorFacetDefaultNumberOfValues - 1 - ); - CommonFacetAssertions.assertSearchInputEmpty(ColorFacetSelectors); - }); - - describe('verify analytics', () => { - it('should log the facet select results to UA ', () => { - cy.expectSearchEvent('facetSelect').then((analyticsBody) => { - expect(analyticsBody.customData).to.have.property( - 'facetField', - colorFacetField - ); - expect(analyticsBody.facetState[0]).to.have.property( - 'state', - 'selected' - ); - expect(analyticsBody.facetState[0]).to.have.property( - 'field', - colorFacetField - ); - expect(analyticsBody.customData).to.have.property( - 'facetValue', - query - ); - }); - }); - }); - }); - }); describe('when selecting a value', () => { const selectionIndex = 1; function setupSelectBoxValue() { @@ -194,6 +135,66 @@ describe('Color Facet Test Suites', () => { }); }); }); + + describe('when searching for a value that returns results', () => { + const query = 'doc'; + function setupSearchFor() { + typeFacetSearchQuery(ColorFacetSelectors, query, true); + } + + beforeEach(setupSearchFor); + describe('verify rendering', () => { + CommonAssertions.assertAccessibility(colorFacetComponent); + ColorFacetAssertions.assertNumberOfIdleBoxValues(1); + CommonFacetAssertions.assertDisplaySearchClearButton( + ColorFacetSelectors, + true + ); + CommonFacetAssertions.assertHighlightsResults( + ColorFacetSelectors, + query + ); + }); + + describe('when selecting a search result', () => { + function setupSelectSearchResult() { + AnalyticsTracker.reset(); + selectIdleBoxValueAt(0); + } + + beforeEach(setupSelectSearchResult); + describe('verify rendering', () => { + ColorFacetAssertions.assertNumberOfSelectedBoxValues(2); + ColorFacetAssertions.assertNumberOfIdleBoxValues( + colorFacetDefaultNumberOfValues - 2 + ); + CommonFacetAssertions.assertSearchInputEmpty(ColorFacetSelectors); + }); + + describe('verify analytics', () => { + it('should log the facet select results to UA ', () => { + cy.expectSearchEvent('facetSelect').then((analyticsBody) => { + expect(analyticsBody.customData).to.have.property( + 'facetField', + colorFacetField + ); + expect(analyticsBody.facetState[0]).to.have.property( + 'state', + 'selected' + ); + expect(analyticsBody.facetState[0]).to.have.property( + 'field', + colorFacetField + ); + expect(analyticsBody.customData).to.have.property( + 'facetValue', + query + ); + }); + }); + }); + }); + }); }); }); @@ -222,7 +223,7 @@ describe('Color Facet Test Suites', () => { ColorFacetSelectors, true ); - // CommonAssertions.assertAccessibility(colorFacetComponent); + CommonAssertions.assertAccessibility(colorFacetComponent); ColorFacetAssertions.assertValuesSortedAlphanumerically(); ColorFacetAssertions.assertNumberOfIdleBoxValues( colorFacetDefaultNumberOfValues * 2 diff --git a/packages/atomic/cypress/e2e/facets/rating-facet/rating-facet.cypress.ts b/packages/atomic/cypress/e2e/facets/rating-facet/rating-facet.cypress.ts index fe73fd5c793..3661e71e90b 100644 --- a/packages/atomic/cypress/e2e/facets/rating-facet/rating-facet.cypress.ts +++ b/packages/atomic/cypress/e2e/facets/rating-facet/rating-facet.cypress.ts @@ -378,10 +378,10 @@ describe('Rating Facet Test Suites', () => { RatingFacetSelectors, ratingFacetDefaultNumberOfIntervals - 1 ); - // RatingFacetAssertions.assertSelectedFacetValueContainsNumberOfStar( - // RatingFacetSelectors, - // 4 - // ); + RatingFacetAssertions.assertSelectedFacetValueContainsNumberOfStar( + RatingFacetSelectors, + 4 + ); }); describe('with depends-on', () => { diff --git a/packages/atomic/cypress/e2e/facets/rating-range-facet/rating-range-facet.cypress.ts b/packages/atomic/cypress/e2e/facets/rating-range-facet/rating-range-facet.cypress.ts index 4a01789b321..0cea0bc6cfe 100644 --- a/packages/atomic/cypress/e2e/facets/rating-range-facet/rating-range-facet.cypress.ts +++ b/packages/atomic/cypress/e2e/facets/rating-range-facet/rating-range-facet.cypress.ts @@ -180,48 +180,47 @@ describe('Rating Range Test Suites', () => { RatingRangeFacetAssertions.assertFacetValueContainsAndUp(); }); - // describe('with custom #maxValueInIndex', () => { - // const customMaxValueInIndex = 3; - // function setupRatingFacetWithCustomMaxValueInIndex() { - // new TestFixture() - // .with( - // addRatingRangeFacet({ - // field: ratingRangeFacetField, - // label: ratingRangeFacetLabel, - // 'number-of-intervals': '5', - // 'max-value-in-index': customMaxValueInIndex, - // }) - // ) - // .init(); - // } + describe('with custom #maxValueInIndex', () => { + const customMaxValueInIndex = 4; + function setupRatingFacetWithCustomMaxValueInIndex() { + new TestFixture() + .with( + addRatingRangeFacet({ + field: ratingRangeFacetField, + label: ratingRangeFacetLabel, + 'max-value-in-index': customMaxValueInIndex, + }) + ) + .init(); + } - // beforeEach(setupRatingFacetWithCustomMaxValueInIndex); - // CommonAssertions.assertAccessibility(ratingRangeFacetComponent); - // CommonAssertions.assertContainsComponentError( - // RatingRangeFacetSelectors, - // false - // ); - // CommonFacetAssertions.assertDisplayFacet(RatingRangeFacetSelectors, true); - // CommonFacetAssertions.assertNumberOfSelectedLinkValues( - // RatingRangeFacetSelectors, - // 0 - // ); - // CommonFacetAssertions.assertNumberOfIdleLinkValues( - // RatingRangeFacetSelectors, - // ratingRangeFacetDefaultNumberOfIntervals - // ); - // RatingFacetAssertions.assertNumberOfStarAtIndex( - // RatingRangeFacetSelectors, - // customMaxValueInIndex - // ); - // RatingFacetAssertions.assertNumberofYellowStar( - // RatingRangeFacetSelectors, - // 0, - // 4, - // customMaxValueInIndex - // ); - // RatingRangeFacetAssertions.assertFacetValueContainsTextOnlyAndUp(); - // }); + beforeEach(setupRatingFacetWithCustomMaxValueInIndex); + CommonAssertions.assertAccessibility(ratingRangeFacetComponent); + CommonAssertions.assertContainsComponentError( + RatingRangeFacetSelectors, + false + ); + CommonFacetAssertions.assertDisplayFacet(RatingRangeFacetSelectors, true); + CommonFacetAssertions.assertNumberOfSelectedLinkValues( + RatingRangeFacetSelectors, + 0 + ); + CommonFacetAssertions.assertNumberOfIdleLinkValues( + RatingRangeFacetSelectors, + ratingRangeFacetDefaultNumberOfIntervals + ); + RatingFacetAssertions.assertNumberOfStarAtIndex( + RatingRangeFacetSelectors, + customMaxValueInIndex + ); + RatingFacetAssertions.assertNumberofYellowStar( + RatingRangeFacetSelectors, + 0, + 4, + customMaxValueInIndex + ); + RatingRangeFacetAssertions.assertFacetValueContainsTextOnlyAndUp(); + }); describe('with custom #minValueInIndex', () => { const customMinValueInIndex = 2; @@ -325,10 +324,10 @@ describe('Rating Range Test Suites', () => { RatingRangeFacetSelectors, ratingRangeFacetDefaultNumberOfIntervals - 1 ); - // RatingFacetAssertions.assertSelectedFacetValueContainsNumberOfStar( - // RatingRangeFacetSelectors, - // 4 - // ); + RatingFacetAssertions.assertSelectedFacetValueContainsNumberOfStar( + RatingRangeFacetSelectors, + 4 + ); RatingRangeFacetAssertions.assertFacetValueContainsTextOnlyAndUp(); }); describe('with depends-on', () => {