Fixed unstable test (#11583)

This commit is contained in:
adam-stasiak-polidea
2020-11-09 02:53:43 +01:00
committed by GitHub
parent ea0abbffb4
commit 24ba5301d1
2 changed files with 34 additions and 17 deletions

View File

@@ -60,13 +60,23 @@ describe('Visualization > Bubble', () => {
// Number of circles are pretty unstable when there are a lot of circles
// Since main functionality is already covered in fitler test below,
// skip this test untill we find a solution.
it.skip('should work', () => {
verify(BUBBLE_FORM_DATA);
// number of circles = 214 rows
cy.get('.chart-container svg .nv-point-clips circle').should(
'have.length',
214,
);
it('should work', () => {
cy.visitChartByParams(JSON.stringify(BUBBLE_FORM_DATA)).then(() => {
cy.wait('@getJson').then(xhr => {
let expectedBubblesNumber = 0;
xhr.responseBody.data.forEach(element => {
expectedBubblesNumber += element.values.length;
});
cy.get('[data-test="chart-container"]')
.should('be.visible', { timeout: 15000 })
.within(() => {
cy.get('svg')
.should('exist')
.find('.nv-point-clips circle')
.should('have.length', expectedBubblesNumber);
});
});
});
});
it('should work with filter', () => {
@@ -84,8 +94,11 @@ describe('Visualization > Bubble', () => {
},
],
});
cy.get('.chart-container svg .nv-point-clips circle')
.should('have.length', 8)
cy.get('[data-test="chart-container"]')
.should('be.visible')
.within(() => {
cy.get('svg').find('.nv-point-clips circle').should('have.length', 8);
})
.then(nodeList => {
// Check that all circles have same color.
const color = nodeList[0].getAttribute('fill');