From d880ea5b49dbb4507efef3e4a40d6010fa7a6226 Mon Sep 17 00:00:00 2001 From: almouro Date: Mon, 28 Oct 2024 17:24:04 +0100 Subject: [PATCH] test: fix flaky test --- packages/commands/measure/src/__tests__/measure.test.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/commands/measure/src/__tests__/measure.test.tsx b/packages/commands/measure/src/__tests__/measure.test.tsx index 04f637f4..0c4f64cc 100644 --- a/packages/commands/measure/src/__tests__/measure.test.tsx +++ b/packages/commands/measure/src/__tests__/measure.test.tsx @@ -95,8 +95,10 @@ describe("flashlight measure interactive", () => { // Simulate measures being emitted on the device act(() => emitMeasures()); + // We should now see 1000ms of measures: 3 measures at 0/500/1000ms + await screen.findByText("1000 ms"); // Find the score! - await screen.findByText("47"); + screen.getByText("47"); // expand threads await screen.findByText("Other threads"); @@ -106,8 +108,8 @@ describe("flashlight measure interactive", () => { // Stop measuring fireEvent.click(screen.getByText("Stop Measuring")); - await waitFor(() => expect(aTraceMock.kill).toBeCalled()); - await waitFor(() => expect(perfProfilerMock.kill).toBeCalled()); + await waitFor(() => expect(aTraceMock.kill).toHaveBeenCalled()); + await waitFor(() => expect(perfProfilerMock.kill).toHaveBeenCalled()); // Close apps