villebro commented on a change in pull request #11685:
URL:
https://github.com/apache/incubator-superset/pull/11685#discussion_r522720221
##########
File path:
superset-frontend/cypress-base/cypress/integration/dashboard/load.test.js
##########
@@ -43,14 +43,19 @@ describe('Dashboard load', () => {
slices.forEach(slice => {
const vizType = slice.form_data.viz_type;
const isLegacy = isLegacyChart(vizType);
- // TODO(villebro): enable V1 charts
if (isLegacy) {
const alias = `getJson_${slice.slice_id}`;
const formData = `{"slice_id":${slice.slice_id}}`;
const route = `/superset/explore_json/?*${formData}*`;
cy.route('POST', `${route}`).as(alias);
aliases.push(`@${alias}`);
}
+ else {
+ const alias = `getV1ChartJson`;
+ const route = `/api/v1/chart/data?*`;
+ cy.route('POST', `${route}`).as(alias);
+ aliases.push(`@${alias}`);
+ }
Review comment:
As the legacy/V1 routes are always the same, I wonder if it would make
sense to add a function to get the route to the `vizPlugins.ts` utility?
##########
File path:
superset-frontend/cypress-base/cypress/integration/dashboard/load.test.js
##########
@@ -59,12 +64,19 @@ describe('Dashboard load', () => {
requests.map(async xhr => {
expect(xhr.status).to.eq(200);
const responseBody = await readResponseBlob(xhr.response.body);
- expect(responseBody).to.have.property('errors');
- expect(responseBody.errors.length).to.eq(0);
- const sliceId = responseBody.form_data.slice_id;
- cy.get('[data-test="grid-content"]')
- .find(`#chart-id-${sliceId}`)
- .should('be.visible');
+ if (responseBody.result) {
+ responseBody.result.forEach(element => {
+ expect(element).to.have.property('error', null);
+ expect(element).to.have.property('status', 'success');
+ });
+ } else {
+ expect(responseBody).to.have.property('errors');
+ expect(responseBody.errors.length).to.eq(0);
+ const sliceId = responseBody.form_data.slice_id;
+ cy.get('[data-test="grid-content"]')
+ .find(`#chart-id-${sliceId}`)
+ .should('be.visible');
Review comment:
I assume this assertion should be possible to do for V1 requests if we
have `slice_id` readily available? If so, perhaps we should add it to the V1
request so the request params are the same for V1 and legacy requests.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]