diff options
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/AddingProviderScreen/test.ts')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/AddingProviderScreen/test.ts | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/packages/anastasis-webui/src/pages/home/AddingProviderScreen/test.ts b/packages/anastasis-webui/src/pages/home/AddingProviderScreen/test.ts index d051d7c0b..8d0e69111 100644 --- a/packages/anastasis-webui/src/pages/home/AddingProviderScreen/test.ts +++ b/packages/anastasis-webui/src/pages/home/AddingProviderScreen/test.ts @@ -20,23 +20,26 @@ */ import { expect } from "chai"; -import { mountHook } from "../../../test-utils.js"; import useComponentState from "./state.js"; +import { tests } from "@gnu-taler/web-util/lib/index.browser"; describe("AddingProviderScreen states", () => { - it("should have status 'no-balance' when balance is empty", async () => { - const { getLastResultOrThrow, waitNextUpdate, assertNoPendingUpdate } = - mountHook(() => - useComponentState({ onCancel: async () => { null } }), - ); - - { - const { status } = getLastResultOrThrow(); - expect(status).equal("no-reducer"); - } - - await assertNoPendingUpdate(); - + it("should not load more if has reach the end", async () => { + const hookBehavior = await tests.hookBehaveLikeThis( + () => { + return useComponentState({ + providerType: "email", + async onCancel() {}, + }); + }, + {}, + [ + ({ status }) => { + expect(status).eq("no-reducer"); + }, + ], + ); + + expect(hookBehavior).deep.eq({ result: "ok" }); }); - }); |