aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/Balance.svelte8
-rw-r--r--src/routes/(static)/login/+page.svelte10
2 files changed, 14 insertions, 4 deletions
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte
index cf61e0b0..4ceaa65a 100644
--- a/src/components/Balance.svelte
+++ b/src/components/Balance.svelte
@@ -22,13 +22,17 @@
<div>
{#if user.haspin && !$pin}
- <button onclick={toggleShow} class="flex gap-2 text-xl">
+ <button
+ onclick={toggleShow}
+ class="flex gap-2 text-xl"
+ data-testid="balance-show"
+ >
<iconify-icon noobserver icon="ph:eye-slash-bold" width="32"
></iconify-icon>
<div class="my-auto">{$t("user.showBalance")}</div>
</button>
{:else if !isNaN(rate)}
- <div class="flex gap-4">
+ <div class="flex gap-4" data-testid="balance-value">
<Amount
amount={Math.max(balance - (id === user.id ? locked || 0 : 0), 0)}
{rate}
diff --git a/src/routes/(static)/login/+page.svelte b/src/routes/(static)/login/+page.svelte
index d25c6e51..23f772d3 100644
--- a/src/routes/(static)/login/+page.svelte
+++ b/src/routes/(static)/login/+page.svelte
@@ -66,7 +66,7 @@
const getRecaptchaToken = () =>
new Promise((resolve, reject) => {
- if (isTor) return resolve("");
+ if (isTor || !recaptchaSiteKey) return resolve("");
if (!browser || !grecaptcha) return reject(new Error("captcha unavailable"));
grecaptcha.ready(() => {
grecaptcha
@@ -182,6 +182,7 @@
<input
name="username"
+ data-testid="login-username"
type="text"
required
bind:value={username}
@@ -198,7 +199,12 @@
>
</div>
- <button type="submit" class="btn btn-accent" bind:this={btn}>
+ <button
+ type="submit"
+ class="btn btn-accent"
+ bind:this={btn}
+ data-testid="login-submit"
+ >
{$t("login.signIn")}
</button>