@@ -35,6 +35,7 @@ const users: User[] = [
3535 lastName : 'User' ,
3636 origin : 'simple' ,
3737 status : Status . ACTIVE ,
38+ tenantId : '1ef2a357-d4b7-4a30-88ca-d1cc627f2994' ,
3839 } ,
3940] ;
4041
@@ -94,6 +95,7 @@ describe('Userauth Module', () => {
9495 firstName : users [ 0 ] . firstName ,
9596 lastName : users [ 0 ] . lastName ,
9697 status : users [ 0 ] . status ,
98+ tenantId : users [ 0 ] . tenantId ,
9799 } ;
98100 const tokenResponse = {
99101 accessToken : `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
@@ -114,7 +116,7 @@ describe('Userauth Module', () => {
114116 . post ( gql )
115117 . send ( {
116118 query :
117- 'mutation { passwordLogin(input: { username: "user@test.com" password: "s3cr3t1234567890" }) { accessToken, refreshToken, user{ id, email, phone, firstName, lastName, status } }}' ,
119+ 'mutation { passwordLogin(input: { username: "user@test.com" password: "s3cr3t1234567890" }) { accessToken, refreshToken, user{ id, email, phone, firstName, lastName, status tenantId } }}' ,
118120 } )
119121 . expect ( 200 )
120122 . expect ( ( res ) => {
@@ -184,6 +186,7 @@ describe('Userauth Module', () => {
184186 inviteToken :
185187 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Inh5ekBrZXl2YWx1ZS5zeXN0ZW1zIiwiaWF0IjoxNjIxNTI1NTE1LCJleHAiOjE2MjE1MjkxMTV9.t8z7rBZKkog-1jirScYU6HE7KVTzatKWjZw8lVz3xLo' ,
186188 status : Status . INVITED ,
189+ tenantId : users [ 0 ] . tenantId ,
187190 } ,
188191 } ;
189192 configService . get ( 'JWT_SECRET' ) . returns ( 's3cr3t1234567890' ) ;
@@ -199,7 +202,7 @@ describe('Userauth Module', () => {
199202 . set ( 'Authorization' , `Bearer ${ token } ` )
200203 . send ( {
201204 query : `mutation { inviteTokenSignup(input: { email: "test@gmail.com"
202- phone: "9947849200" firstName: "Test" lastName: "Name" }) { inviteToken tokenExpiryTime user{id firstName lastName inviteToken status}}}` ,
205+ phone: "9947849200" firstName: "Test" lastName: "Name" }) { inviteToken tokenExpiryTime user{id firstName lastName inviteToken status tenantId }}}` ,
203206 } )
204207 . expect ( 200 )
205208 . expect ( ( res ) => {
@@ -283,6 +286,7 @@ describe('Userauth Module', () => {
283286 inviteToken :
284287 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Inh5ekBrZXl2YWx1ZS5zeXN0ZW1zIiwiaWF0IjoxNjIxNTI1NTE1LCJleHAiOjE2MjE1MjkxMTV9.t8z7rBZKkog-1jirScYU6HE7KVTzatKWjZw8lVz3xLo' ,
285288 status : Status . INVITED ,
289+ tenantId : users [ 0 ] . tenantId ,
286290 } ,
287291 } ;
288292 tokenService
@@ -303,6 +307,7 @@ describe('Userauth Module', () => {
303307 lastName
304308 inviteToken
305309 status
310+ tenantId
306311 }
307312 }
308313 }` ,
@@ -340,6 +345,7 @@ describe('Userauth Module', () => {
340345 firstName : users [ 0 ] . firstName ,
341346 lastName : users [ 0 ] . lastName ,
342347 status : users [ 0 ] . status ,
348+ tenantId : users [ 0 ] . tenantId ,
343349 } ;
344350 const tokenResponse : TokenResponse = { ...token , user : user } ;
345351 tokenService
@@ -349,7 +355,7 @@ describe('Userauth Module', () => {
349355 return request ( app . getHttpServer ( ) )
350356 . post ( gql )
351357 . send ( {
352- query : `mutation { refresh(input: { refreshToken: "${ token . refreshToken } "}) { accessToken refreshToken user { id, email, phone, firstName, lastName, status} }}` ,
358+ query : `mutation { refresh(input: { refreshToken: "${ token . refreshToken } "}) { accessToken refreshToken user { id, email, phone, firstName, lastName, status tenantId } }}` ,
353359 } )
354360 . expect ( 200 )
355361 . expect ( ( res ) => {
0 commit comments