@@ -2,60 +2,6 @@ import { describe, it, expect } from 'vitest';
22import { getAuthErrorDescription } from '@/app/errorDescription' ;
33
44describe ( 'errorDescription' , ( ) => {
5- it ( 'OAuthSignin should return value' , ( ) => {
6- expect ( getAuthErrorDescription ( 'OAuthSignin' ) ) . toEqual (
7- 'Error in constructing an authorization URL.' ,
8- ) ;
9- } ) ;
10-
11- it ( 'OAuthCallback should return value' , ( ) => {
12- expect ( getAuthErrorDescription ( 'OAuthCallback' ) ) . toEqual (
13- 'Error in handling the response from an OAuth provider.' ,
14- ) ;
15- } ) ;
16-
17- it ( 'OAuthCreateAccount should return value' , ( ) => {
18- expect ( getAuthErrorDescription ( 'OAuthCreateAccount' ) ) . toEqual (
19- 'Could not create OAuth provider user in the database.' ,
20- ) ;
21- } ) ;
22-
23- it ( 'EmailCreateAccount should return value' , ( ) => {
24- expect ( getAuthErrorDescription ( 'EmailCreateAccount' ) ) . toEqual (
25- 'Could not create email provider user in the database.' ,
26- ) ;
27- } ) ;
28-
29- it ( 'Callback should return value' , ( ) => {
30- expect ( getAuthErrorDescription ( 'Callback' ) ) . toEqual (
31- 'Error in the OAuth callback handler route.' ,
32- ) ;
33- } ) ;
34-
35- it ( 'OAuthAccountNotLinked should return value' , ( ) => {
36- expect ( getAuthErrorDescription ( 'OAuthAccountNotLinked' ) ) . toEqual (
37- 'If the email on the account is already linked, but not with this OAuth account.' ,
38- ) ;
39- } ) ;
40-
41- it ( 'EmailSignin should return value' , ( ) => {
42- expect ( getAuthErrorDescription ( 'EmailSignin' ) ) . toEqual (
43- 'Sending the e-mail with the verification token failed.' ,
44- ) ;
45- } ) ;
46-
47- it ( 'CredentialsSignin should return value' , ( ) => {
48- expect ( getAuthErrorDescription ( 'CredentialsSignin' ) ) . toEqual (
49- "The authorize callback returned null in the Credentials provider. We don't recommend providing information about which part of the credentials were wrong, as it might be abused by malicious hackers." ,
50- ) ;
51- } ) ;
52-
53- it ( 'SessionRequired should return value' , ( ) => {
54- expect ( getAuthErrorDescription ( 'SessionRequired' ) ) . toEqual (
55- 'The content of this page requires you to be signed in at all times. See useSession for configuration.' ,
56- ) ;
57- } ) ;
58-
595 it ( 'Configuration should return value' , ( ) => {
606 expect ( getAuthErrorDescription ( 'Configuration' ) ) . toEqual (
617 'There is a problem with the server configuration. Check if your options are correct.' ,
@@ -74,15 +20,15 @@ describe('errorDescription', () => {
7420 ) ;
7521 } ) ;
7622
77- it ( 'default should return value' , ( ) => {
78- expect ( getAuthErrorDescription ( '' ) ) . toEqual (
79- 'Catch all, will apply, if none of the other errors matched.' ,
23+ it ( 'Default should return value' , ( ) => {
24+ expect ( getAuthErrorDescription ( 'EmailCreateAccount ' ) ) . toEqual (
25+ 'Catch all, will apply, if none of the above matched.' ,
8026 ) ;
8127 } ) ;
8228
8329 it ( 'default should return value' , ( ) => {
8430 expect ( getAuthErrorDescription ( null ) ) . toEqual (
85- 'Catch all, will apply, if none of the other errors matched.' ,
31+ 'Catch all, will apply, if none of the above matched.' ,
8632 ) ;
8733 } ) ;
8834} ) ;
0 commit comments