From 4db8966ea941fb194d8d2b138881b0910eed98a0 Mon Sep 17 00:00:00 2001 From: "Ziyuan (Jerry) Zhang" Date: Mon, 4 Mar 2024 12:33:24 -0500 Subject: [PATCH] t --- demo/src/__tests__/MemoryModels.spec.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/demo/src/__tests__/MemoryModels.spec.tsx b/demo/src/__tests__/MemoryModels.spec.tsx index 0172cfc1..25c796cb 100644 --- a/demo/src/__tests__/MemoryModels.spec.tsx +++ b/demo/src/__tests__/MemoryModels.spec.tsx @@ -150,7 +150,12 @@ describe("MemoryModelsUserInput", () => { // wait until the button is enabled to click expect(reapplyBtn).toHaveProperty("disabled", false); fireEvent.click(reapplyBtn); + }); + + await waitFor(() => { // once from reapplyBtn onChange, once from MemoryModelsTextInput handleTextFieldChange + // if put within the same waitFor block as fireEvent.click(reapplyBtn), this test always passes + // even with the wrong expect expect(setTextDataMock).toHaveBeenNthCalledWith( 2, fileString