Skip to content

Commit

Permalink
Revert "ci: temporarily disable some tests failing due to SAPI (#4294)"
Browse files Browse the repository at this point in the history
This reverts commit c4fa7b6.
  • Loading branch information
louis-bompart committed Aug 22, 2024
1 parent 7f4fcfe commit 2740cdf
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 108 deletions.
119 changes: 60 additions & 59 deletions packages/atomic/cypress/e2e/facets/color-facet/color-facet.cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -194,6 +135,66 @@ describe('Color Facet Test Suites', () => {
});
});
});

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(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
);
});
});
});
});
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ describe('Rating Facet Test Suites', () => {
RatingFacetSelectors,
ratingFacetDefaultNumberOfIntervals - 1
);
// RatingFacetAssertions.assertSelectedFacetValueContainsNumberOfStar(
// RatingFacetSelectors,
// 4
// );
RatingFacetAssertions.assertSelectedFacetValueContainsNumberOfStar(
RatingFacetSelectors,
4
);
});

describe('with depends-on', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 2740cdf

Please sign in to comment.