chore(auth): surface exact NextAuth client error #30
Annotations
3 errors
|
check
Process completed with exit code 1.
|
|
tests/components/login-form.test.tsx > LoginForm > calls toast.error when signIn returns ok: false:
tests/components/login-form.test.tsx#L98
AssertionError: expected "vi.fn()" to be called with arguments: [ 'Failed to sign in with GitHub' ]
Received:
1st vi.fn() call:
[
- "Failed to sign in with GitHub",
+ "Failed to sign in: OAuthError",
]
Number of calls: 1
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="bg-card text-card-foreground border-border/80 flex flex-col gap-6 rounded-xl border py-6 shadow-none w-full max-w-md"
data-slot="card"
>
<div
class="@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6"
data-slot="card-header"
>
<div
class="font-semibold text-2xl"
data-slot="card-title"
>
Sign In
</div>
<div
class="text-muted-foreground text-sm"
data-slot="card-description"
>
Sign in with GitHub to access your account
</div>
</div>
<form>
<div
class="px-6"
data-slot="card-content"
>
<button
class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/40 focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 has-[>svg]:px-3 w-full"
data-slot="button"
type="submit"
>
<svg
aria-hidden="true"
class="lucide lucide-github mr-2 h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"
/>
<path
d="M9 18c-4.51 2-5-2-7-2"
/>
</svg>
Sign in with GitHub
</button>
</div>
<div
class="items-center px-6 [.border-t]:pt-6 flex flex-col gap-2"
data-slot="card-footer"
>
<p
class="text-muted-foreground text-center text-xs"
>
By signing in, you agree to use your GitHub account for authentication.
</p>
</div>
</form>
</div>
</div>
</body>
</html>
❯ tests/components/login-form.test.tsx:98:27
❯ runWithExpensiveErrorDiagnosticsDisabled node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
|
tests/components/login-form.test.tsx > LoginForm > calls toast.error when signIn rejects:
tests/components/login-form.test.tsx#L79
AssertionError: expected "vi.fn()" to be called with arguments: [ 'Failed to sign in with GitHub' ]
Received:
1st vi.fn() call:
[
- "Failed to sign in with GitHub",
+ "Failed to sign in catch: Auth failed",
]
Number of calls: 1
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="bg-card text-card-foreground border-border/80 flex flex-col gap-6 rounded-xl border py-6 shadow-none w-full max-w-md"
data-slot="card"
>
<div
class="@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6"
data-slot="card-header"
>
<div
class="font-semibold text-2xl"
data-slot="card-title"
>
Sign In
</div>
<div
class="text-muted-foreground text-sm"
data-slot="card-description"
>
Sign in with GitHub to access your account
</div>
</div>
<form>
<div
class="px-6"
data-slot="card-content"
>
<button
class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/40 focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 has-[>svg]:px-3 w-full"
data-slot="button"
type="submit"
>
<svg
aria-hidden="true"
class="lucide lucide-github mr-2 h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"
/>
<path
d="M9 18c-4.51 2-5-2-7-2"
/>
</svg>
Sign in with GitHub
</button>
</div>
<div
class="items-center px-6 [.border-t]:pt-6 flex flex-col gap-2"
data-slot="card-footer"
>
<p
class="text-muted-foreground text-center text-xs"
>
By signing in, you agree to use your GitHub account for authentication.
</p>
</div>
</form>
</div>
</div>
</body>
</html>
❯ tests/components/login-form.test.tsx:79:27
❯ runWithExpensiveErrorDiagnosticsDisabled node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback node_modules/@testing-library/dom/dist/wait-for.js:118:16
|