From 84df6f233677a16f8a3f84b3eb7e77923da2c7fa Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 26 Sep 2021 14:15:33 +0900 Subject: Use jest API and fix some tests --- test/console/components/console/Completion.test.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/console/components') diff --git a/test/console/components/console/Completion.test.tsx b/test/console/components/console/Completion.test.tsx index 9b47637..063b1e3 100644 --- a/test/console/components/console/Completion.test.tsx +++ b/test/console/components/console/Completion.test.tsx @@ -100,7 +100,7 @@ describe("console/components/console/completion/Completion", () => { }); it("scrolls up to down with select", () => { - let component: ReturnType | null = null; + let component: ReactTestRenderer.ReactTestRenderer | null = null; ReactTestRenderer.act(() => { component = ReactTestRenderer.create( @@ -108,7 +108,7 @@ describe("console/components/console/completion/Completion", () => { ); }); - const root = component.root; + const root = component!.root; let items = root.findAllByType(CompletionItem); let showns = root @@ -132,7 +132,7 @@ describe("console/components/console/completion/Completion", () => { ]); ReactTestRenderer.act(() => { - component.update( + component!.update( ); }); @@ -159,7 +159,7 @@ describe("console/components/console/completion/Completion", () => { expect(items[2].props.highlight).to.be.true; ReactTestRenderer.act(() => { - component.update( + component!.update( ); }); @@ -187,14 +187,14 @@ describe("console/components/console/completion/Completion", () => { }); it("scrolls down to up with select", () => { - let component: ReturnType | null = null; + let component: ReactTestRenderer.ReactTestRenderer | null = null; ReactTestRenderer.act(() => { component = ReactTestRenderer.create( ); }); - const root = component.root; + const root = component!.root; let items = root.findAllByType(CompletionItem); let showns = root @@ -220,7 +220,7 @@ describe("console/components/console/completion/Completion", () => { expect(items[5].props.highlight).to.be.true; ReactTestRenderer.act(() => { - component.update( + component!.update( ); }); @@ -247,7 +247,7 @@ describe("console/components/console/completion/Completion", () => { expect(items[4].props.highlight).to.be.true; ReactTestRenderer.act(() => { - component.update( + component!.update( ); }); @@ -274,7 +274,7 @@ describe("console/components/console/completion/Completion", () => { expect(items[3].props.highlight).to.be.true; ReactTestRenderer.act(() => { - component.update( + component!.update( ); }); -- cgit v1.2.3