Fix/updating datasources does not update sidebar (#2018)

* add check for datasources in memo equality check

* add test cases

* update test cases

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro.local>
This commit is contained in:
Pawan Kumar 2020-12-08 14:54:02 +05:30 committed by GitHub
parent 19d6ad695e
commit c67ada9a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 3 deletions

View File

@ -50,7 +50,38 @@ describe("Entity explorer tests related to query and datasource", function() {
200,
);
cy.get(queryLocators.templateMenu).click();
cy.wait(2000);
cy.go("back");
cy.contains(".t--datasource-name", datasourceName)
.find(queryLocators.editDatasourceButton)
.click();
cy.get(".t--edit-datasource-name").click();
cy.get(".t--edit-datasource-name input")
.clear()
.type(`${datasourceName}new`, { force: true })
.blur();
cy.contains(commonlocators.entityName, `${datasourceName}new`);
// reverting the name
cy.get(".t--edit-datasource-name").click();
cy.get(".t--edit-datasource-name input")
.clear()
.type(`${datasourceName}`, { force: true })
.blur();
// going to the query create page
cy.contains(commonlocators.entityName, "Query1").click();
cy.get("@getPluginForm").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
// cy.get(queryLocators.templateMenu).click();
cy.get(".CodeMirror textarea")
.first()
.focus()

View File

@ -6,5 +6,6 @@
"deleteQuery": ".t--delete-query",
"createQuery": ".t--create-query",
"addQueryEntity": ".//div[contains(@class,'t--entity group queries')]//div[contains(@class,'t--entity-add-btn')]",
"addDatasource": ".t--add-datasource"
"addDatasource": ".t--add-datasource",
"editDatasourceButton": ".t--edit-datasource"
}

View File

@ -81,9 +81,9 @@
"selectedZoomlevel": ".t--property-control-maxzoomlevel button span",
"imgWidget": "div[data-testid='styledImage']",
"selectTab": ".t--tab-Tab",
"entityName": ".t--entity-name",
"filePickerButton": ".t--widget-filepickerwidget",
"filePickerInput": ".uppy-Dashboard-input",
"filePickerUploadButton": ".uppy-StatusBar-actionBtn--upload",
"filePickerOnFilesSelected": ".t--property-control-onfilesselected"
}

View File

@ -31,6 +31,7 @@ const pageGroupEqualityCheck = (
return (
prev.widgets === next.widgets &&
prev.actions === next.actions &&
prev.datasources === next.datasources &&
prev.searchKeyword === next.searchKeyword
);
};