diff --git a/api/js/etemplate/Et2Select/test/Et2SelectOptions.test.ts b/api/js/etemplate/Et2Select/test/Et2SelectOptions.test.ts index 8558006c26..f6d2905fb0 100644 --- a/api/js/etemplate/Et2Select/test/Et2SelectOptions.test.ts +++ b/api/js/etemplate/Et2Select/test/Et2SelectOptions.test.ts @@ -111,6 +111,39 @@ describe("Select widget", () => assert.includeMembers(option_keys, ["1", "2", "option"], "Option mis-match"); assert.equal(option_keys.length, 3); }); + + it("actually shows the options", async() => + { + // Create an element to test with, and wait until it's ready + // @ts-ignore + element = await fixture(html` + + `); + // Stub egw() + sinon.stub(element, "egw").returns(window.egw); + element.select_options = [ + {value: "one", label: "one"}, + {value: "two", label: "two"}, + {value: "three", label: "three"}, + {value: "four", label: "four"}, + {value: "five", label: "five"} + ]; + + await element.updateComplete; + await elementUpdated(element); + + await element.show(); + + // Not actually testing if the browser renders, just if they show where expected + const options = element.select.querySelectorAll("sl-option"); + assert.equal(options.length, 5, "Wrong number of options"); + + // Still not checking if they're _really_ visible, just that they have the correct display + options.forEach(o => + { + assert.equal(getComputedStyle(o).display, "block", "Wrong style.display"); + }) + }); }); describe("Value tests", () => diff --git a/api/js/etemplate/Et2Select/test/SearchActions.test.ts b/api/js/etemplate/Et2Select/test/SearchActions.test.ts index 52c08199c8..b7e0f37f49 100644 --- a/api/js/etemplate/Et2Select/test/SearchActions.test.ts +++ b/api/js/etemplate/Et2Select/test/SearchActions.test.ts @@ -313,6 +313,9 @@ describe("Search results", () => // Enable multiple element.multiple = true; + // Clear auto-selected value + element.value = ""; + // Enable searching element.searchUrl = "test";