aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-06-06 00:09:25 -0300
committerSebastian <sebasjm@gmail.com>2022-06-06 00:09:25 -0300
commitfb6aff76d2152d95caa2ba6cb0d91cb01e0687fe (patch)
tree2dc9b0a4935f60ba7229fd81332ec4a41ad4698c /packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts
parent912813fd09ee2f757e4d6d509a911159b46153a7 (diff)
downloadwallet-core-fb6aff76d2152d95caa2ba6cb0d91cb01e0687fe.tar.xz
prettier
Diffstat (limited to 'packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts')
-rw-r--r--packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts39
1 files changed, 19 insertions, 20 deletions
diff --git a/packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts b/packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts
index 4893d43ff..7cf97265e 100644
--- a/packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts
+++ b/packages/taler-wallet-webextension/src/hooks/useTalerActionURL.test.ts
@@ -14,48 +14,47 @@
You should have received a copy of the GNU General Public License along with
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import { useTalerActionURL } from "./useTalerActionURL.js"
+import { useTalerActionURL } from "./useTalerActionURL.js";
import { mountHook } from "../test-utils.js";
import { IoCProviderForTesting } from "../context/iocContext.js";
import { h, VNode } from "preact";
import { expect } from "chai";
-describe('useTalerActionURL hook', () => {
-
- it('should be set url to undefined when dismiss', async () => {
-
+describe("useTalerActionURL hook", () => {
+ it("should be set url to undefined when dismiss", async () => {
const ctx = ({ children }: { children: any }): VNode => {
return h(IoCProviderForTesting, {
value: {
findTalerUriInActiveTab: async () => "asd",
- }, children
- })
- }
+ },
+ children,
+ });
+ };
- const { getLastResultOrThrow, waitNextUpdate, assertNoPendingUpdate } = mountHook(useTalerActionURL, ctx)
+ const { getLastResultOrThrow, waitNextUpdate, assertNoPendingUpdate } =
+ mountHook(useTalerActionURL, ctx);
{
- const [url] = getLastResultOrThrow()
+ const [url] = getLastResultOrThrow();
expect(url).undefined;
}
-
- await waitNextUpdate("waiting for useEffect")
+ await waitNextUpdate("waiting for useEffect");
{
- const [url, setDismissed] = getLastResultOrThrow()
+ const [url, setDismissed] = getLastResultOrThrow();
expect(url).equals("asd");
- setDismissed(true)
+ setDismissed(true);
}
- await waitNextUpdate("after dismiss")
+ await waitNextUpdate("after dismiss");
{
- const [url] = getLastResultOrThrow()
- if (url !== undefined) throw Error('invalid')
+ const [url] = getLastResultOrThrow();
+ if (url !== undefined) throw Error("invalid");
expect(url).undefined;
}
- await assertNoPendingUpdate()
- })
-}) \ No newline at end of file
+ await assertNoPendingUpdate();
+ });
+});