From 1500c3b11febccc62227a048a698d3f033e45ba1 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Wed, 16 Oct 2024 08:42:13 -0700 Subject: [PATCH] fix tests (#9720) Co-authored-by: Dawood Khan --- js/dropdown/dropdown.test.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/dropdown/dropdown.test.ts b/js/dropdown/dropdown.test.ts index afd308016a..d31ec29f90 100644 --- a/js/dropdown/dropdown.test.ts +++ b/js/dropdown/dropdown.test.ts @@ -273,7 +273,7 @@ describe("Dropdown", () => { { show_label: true, loading_status, - value: "", + value: "apple", allow_custom_value: false, label: "Dropdown", choices: [ @@ -303,7 +303,7 @@ describe("Dropdown", () => { { show_label: true, loading_status, - value: "", + value: "apple", allow_custom_value: true, label: "Dropdown", choices: [ @@ -333,7 +333,7 @@ describe("Dropdown", () => { { show_label: true, loading_status, - value: "", + value: "apple", allow_custom_value: false, label: "Dropdown", choices: [ @@ -377,7 +377,7 @@ describe("Dropdown", () => { { show_label: true, loading_status, - value: "", + value: "apple_internal_value", allow_custom_value: false, label: "Dropdown", choices: [ @@ -477,6 +477,7 @@ describe("Dropdown", () => { show_label: true, loading_status, allow_custom_value: false, + value: "apple_internal_value", label: "Dropdown", choices: [ ["apple_choice", "apple_internal_value"], @@ -491,7 +492,7 @@ describe("Dropdown", () => { await expect(item.value).toBe("apple_choice"); }); - test("ensure dropdown works when initial value is undefined and allow custom value is set", async () => { + test("ensure dropdown works when initial value is undefined and allow_custom_value is true", async () => { const { getByLabelText } = await render(Dropdown, { show_label: true, loading_status, @@ -508,6 +509,6 @@ describe("Dropdown", () => { const item: HTMLInputElement = getByLabelText( "Dropdown" ) as HTMLInputElement; - await expect(item.value).toBe("apple_choice"); + await expect(item.value).toBe(""); }); });