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