From e82e9c5fc15c087b268f2c96efb8a2b7c34863e2 Mon Sep 17 00:00:00 2001 From: Jialecl Date: Fri, 25 Mar 2022 12:35:03 +0100 Subject: [PATCH] File input test fix --- .../src/lib/dxc-file-input/dxc-file-input.component.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.spec.ts b/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.spec.ts index 24f231b19..5dd43c821 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.spec.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.spec.ts @@ -82,9 +82,8 @@ describe("DxcFileInputComponent", () => { type: "text/plain", }); fireEvent.change(inputEl, { target: { files: [file] } }); - await waitFor(() => { - expect(() => screen.getByText("foo.txt")).toThrow(); - }); + const fileInScreen = screen.queryByText("foo.txt"); + expect(fileInScreen).toBeFalsy(); }); test("should render error when file does not meet minSize", async () => {