1- import {
2- Authentication ,
3- AuthenticationProps ,
4- AuthProvider ,
5- } from "@/domain/entities" ;
1+ import { Authentication , AuthenticationProps } from "@/domain/entities" ;
62
73describe ( "Authentication Entity" , ( ) => {
84 const baseProps : AuthenticationProps = {
95 id : "auth-1" ,
106 userId : "user-1" ,
11- provider : "local" ,
127 passwordHash : "hashed-password" ,
138 refreshToken : "refresh-token" ,
149 createdAt : new Date ( "2023-01-01T00:00:00Z" ) ,
@@ -19,7 +14,6 @@ describe("Authentication Entity", () => {
1914 const auth = new Authentication ( baseProps ) ;
2015 expect ( auth . getId ) . toBe ( baseProps . id ) ;
2116 expect ( auth . getUserId ) . toBe ( baseProps . userId ) ;
22- expect ( auth . getProvider ) . toBe ( baseProps . provider ) ;
2317 expect ( auth . getPasswordHash ) . toBe ( baseProps . passwordHash ) ;
2418 expect ( auth . getRefreshToken ) . toBe ( baseProps . refreshToken ) ;
2519 expect ( auth . createdAt ) . toEqual ( baseProps . createdAt ) ;
@@ -45,13 +39,4 @@ describe("Authentication Entity", () => {
4539 expect ( auth . getPasswordHash ) . toBe ( "changed-hash" ) ;
4640 expect ( auth . getRefreshToken ) . toBe ( "changed-refresh" ) ;
4741 } ) ;
48-
49- it ( "should support all AuthProvider values" , ( ) => {
50- const providers : AuthProvider [ ] = [ "local" , "google" ] ;
51- for ( const provider of providers ) {
52- const props = { ...baseProps , provider } ;
53- const auth = new Authentication ( props ) ;
54- expect ( auth . getProvider ) . toBe ( provider ) ;
55- }
56- } ) ;
5742} ) ;
0 commit comments