Skip to content

Commit

Permalink
fix(ui5-multi-combobox): remove value state header on validation reset (
Browse files Browse the repository at this point in the history
#8832)

* fix(ui5-multi-combobox): remove value state header on validation reset

fixes: #8674

* restore wdio.js config
  • Loading branch information
ndeshev committed Apr 24, 2024
1 parent 2f6fe6c commit 5cad77b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/main/src/MultiComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ class MultiComboBox extends UI5Element {
_resetValueState(valueState: `${ValueState}`, callback?: () => void) {
this._validationTimeout = setTimeout(() => {
this._effectiveValueState = this.valueState;
this._dialogInputValueState = valueState;
this.valueState = valueState;
this._validationTimeout = null;

Expand Down
16 changes: 16 additions & 0 deletions packages/main/test/specs/MultiComboBox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,22 @@ describe("MultiComboBox general interaction", () => {
}, 2500, "expect value state to be different after 2.5 seconds");
});

it("should remove the value state header after validation reset", async () => {
const mcb = await browser.$("#mcb-predefined-value");
const innerInput = await browser.$("#mcb-predefined-value").shadow$("#ui5-multi-combobox-input");
const icon = await mcb.shadow$("[input-icon]");

await innerInput.click();
await innerInput.keys("d");
await icon.click();

assert.strictEqual(await innerInput.getAttribute("value-state"), "Error", "Value state is changed to error");

await browser.waitUntil(async () => {
return await mcb.getAttribute("_dialog-input-value-state") === "None";
}, 2500, "expect _dialog-input-value-state to be reset after 2.5 seconds");
});

it("tests if entering valid text is possible while validation is triggered", async () => {
const mcb = await $("#mcb-validation");
const innerInput = mcb.shadow$("#ui5-multi-combobox-input");
Expand Down

0 comments on commit 5cad77b

Please sign in to comment.