-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Adding line and big number total integration tests #5846
Adding line and big number total integration tests #5846
Conversation
@@ -4,7 +4,6 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps break this file into multiple files, one per chart, to avoid this becoming viz.py
}); | ||
}); | ||
|
||
Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps change getSvg:boolean
to chartSelector:String
will make this more flexible and support non-svg charts as well.
Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => { | ||
cy.wait([waitAlias]).then((data) => { | ||
expect(data.status).to.eq(200); | ||
expect(data.response.body).to.have.property('error', null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if error
is undefined
?
} | ||
cy.get('.slice_container').within(() => { | ||
if (getSvg) { | ||
cy.get('svg').should('have.attr', 'height').then((height) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// change 'svg' to the chartSelector parameter to support 'div', 'table', etc.
if(chartSelector) {
cy.get(chartSelector).then(chart => {
// This should work for getting DOM element dimension in general
// to support div that has no 'width', 'height' attributes.
expect(chart.clientWidth).greaterThan(0);
expect(chart.clientHeight).greaterThan(0);
});
}
}); | ||
|
||
Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => { | ||
cy.wait([waitAlias]).then((data) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can cy.wait()
take the alias string directly without wrapping it into an array?
cy.wait(waitAlias)
Codecov Report
@@ Coverage Diff @@
## master #5846 +/- ##
==========================================
+ Coverage 63.73% 63.75% +0.01%
==========================================
Files 368 374 +6
Lines 23221 23320 +99
Branches 2600 2608 +8
==========================================
+ Hits 14801 14867 +66
- Misses 8405 8440 +35
+ Partials 15 13 -2
Continue to review full report at Codecov.
|
Thanks for all the good comments Krist! |
* Adding line and big number total integration tests * Breakout visualization tests into multiple files
* Adding line and big number total integration tests * Breakout visualization tests into multiple files
Created tests for different configurations of line chart and big number total.
Adding a check for svg height and width > 0 where appropriate. Also adding a check if the query contains a substring (to make sure the metric exists in the query for example).
@graceguo-supercat @kristw