Merge branch 'release' of github.com:appsmithorg/appsmith into release

This commit is contained in:
Hetu Nandu 2020-10-22 01:36:08 +05:30
commit 63e5e24c2b
4 changed files with 26 additions and 9 deletions

View File

@ -3,7 +3,7 @@
"defaultCommandTimeout": 20000,
"requestTimeout": 21000,
"pageLoadTimeout": 20000,
"video": false,
"video": true,
"reporter": "mochawesome",
"reporterOptions": {
"reportDir": "results",

View File

@ -1,20 +1,33 @@
const commonlocators = require("../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../locators/FormWidgets.json");
const widgetLocators = require("../../../locators/Widgets.json");
const publish = require("../../../locators/publishWidgetspage.json");
const dsl = require("../../../fixtures/newFormDsl.json");
const pages = require("../../../locators/Pages.json");
const data = require("../../../fixtures/example.json");
describe("Dropdown Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
});
it("Dropdown Widget Functionality", function() {
it("Selects value with invalid default value", () => {
cy.openPropertyPane("dropdownwidget");
/**
* @param{Text} Random Text
* @param{DropdownWidget}Mouseover
* @param{DropdownPre Css} Assertion
*/
cy.testJsontext("options", JSON.stringify(data.input));
cy.testJsontext("defaultoption", "Not an option");
cy.get(formWidgetsPage.dropdownWidget)
.find(widgetLocators.dropdownSingleSelect)
.click({ force: true });
cy.get(commonlocators.singleSelectMenuItem)
.contains("Option 3")
.click({ force: true });
cy.get(formWidgetsPage.dropdownWidget)
.find(widgetLocators.defaultSingleSelectValue)
.should("have.text", "Option 3");
});
it("Dropdown Widget Functionality", function() {
cy.widgetText(
"lock",
formWidgetsPage.dropdownWidget,
@ -30,7 +43,6 @@ describe("Dropdown Widget Functionality", function() {
cy.get(formWidgetsPage.dropdownSelectionType)
.find(commonlocators.menuSelection)
.should("have.text", "Multi Select");
cy.testJsontext("options", JSON.stringify(this.data.input));
/**
* @param{Show Alert} Css for InputChange
*/

View File

@ -41,6 +41,7 @@
"videoWidget": ".t--draggable-videowidget",
"autoPlay": ".t--property-control-autoplay > .bp3-control > .bp3-control-indicator",
"defaultOption": ".t--property-control-defaultoption .CodeMirror-code",
"dropdownSingleSelect": ".bp3-popover-target > div > .bp3-button",
"defaultSingleSelectValue": ".bp3-popover-target > div > .bp3-button > .bp3-button-text",
"widgetBtn": ".t--widget-buttonwidget button",
"actionSelect": ".t--open-dropdown-Select-Action",

View File

@ -101,7 +101,11 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
onOptionSelected = (selectedOption: DropdownOption) => {
let isChanged = true;
if (this.props.selectionType === "SINGLE_SELECT") {
isChanged = !(this.props.selectedOption.value === selectedOption.value);
// Check if the value has changed. If no option
// selected till now, there is a change
if (this.props.selectedOption) {
isChanged = !(this.props.selectedOption.value === selectedOption.value);
}
if (isChanged) {
this.props.updateWidgetMetaProperty(
"selectedOptionValue",