@@ -82,41 +82,6 @@ describe('UserModel SSO identities', () => {
8282 } ) ;
8383 } ) ;
8484
85- it ( 'should allow linking identities for multiple workspaces' , async ( ) => {
86- const workspaceId2 = '507f1f77bcf86cd799439012' ;
87- const samlId2 = 'test-saml-name-id-456' ;
88- const email2 = '[email protected] ' ; 89-
90- /**
91- * Link identity for first workspace
92- */
93- await testUser . linkSamlIdentity ( testWorkspaceId , testSamlId , testEmail ) ;
94-
95- /**
96- * Link identity for second workspace
97- */
98- await testUser . linkSamlIdentity ( workspaceId2 , samlId2 , email2 ) ;
99-
100- /**
101- * Check that both identities are present
102- */
103- expect ( testUser . identities ! [ testWorkspaceId ] . saml ) . toEqual ( {
104- id : testSamlId ,
105- email : testEmail ,
106- } ) ;
107- expect ( testUser . identities ! [ workspaceId2 ] . saml ) . toEqual ( {
108- id : samlId2 ,
109- email : email2 ,
110- } ) ;
111-
112- /**
113- * Verify in database
114- */
115- const reloadedUser = await usersFactory . findById ( testUser . _id . toString ( ) ) ;
116- expect ( reloadedUser ! . identities ! [ testWorkspaceId ] . saml . id ) . toBe ( testSamlId ) ;
117- expect ( reloadedUser ! . identities ! [ workspaceId2 ] . saml . id ) . toBe ( samlId2 ) ;
118- } ) ;
119-
12085 it ( 'should update existing SAML identity for the same workspace' , async ( ) => {
12186 const newSamlId = 'updated-saml-name-id-789' ;
12287 const newEmail = '[email protected] ' ; @@ -159,20 +124,6 @@ describe('UserModel SSO identities', () => {
159124 expect ( identity ) . toBeNull ( ) ;
160125 } ) ;
161126
162- it ( 'should return null for non-existent workspace' , async ( ) => {
163- /**
164- * Link identity for one workspace
165- */
166- await testUser . linkSamlIdentity ( testWorkspaceId , testSamlId , testEmail ) ;
167-
168- /**
169- * Try to get identity for different workspace
170- */
171- const nonExistentWorkspaceId = '507f1f77bcf86cd799439099' ;
172- const identity = testUser . getSamlIdentity ( nonExistentWorkspaceId ) ;
173- expect ( identity ) . toBeNull ( ) ;
174- } ) ;
175-
176127 it ( 'should return SAML identity when it exists' , async ( ) => {
177128 /**
178129 * Link SAML identity
@@ -190,36 +141,6 @@ describe('UserModel SSO identities', () => {
190141 email : testEmail ,
191142 } ) ;
192143 } ) ;
193-
194- it ( 'should return correct identity for specific workspace when multiple exist' , async ( ) => {
195- const workspaceId2 = '507f1f77bcf86cd799439012' ;
196- const samlId2 = 'test-saml-name-id-456' ;
197- const email2 = '[email protected] ' ; 198-
199- /**
200- * Link identities for two workspaces
201- */
202- await testUser . linkSamlIdentity ( testWorkspaceId , testSamlId , testEmail ) ;
203- await testUser . linkSamlIdentity ( workspaceId2 , samlId2 , email2 ) ;
204-
205- /**
206- * Get identity for first workspace
207- */
208- const identity1 = testUser . getSamlIdentity ( testWorkspaceId ) ;
209- expect ( identity1 ) . toEqual ( {
210- id : testSamlId ,
211- email : testEmail ,
212- } ) ;
213-
214- /**
215- * Get identity for second workspace
216- */
217- const identity2 = testUser . getSamlIdentity ( workspaceId2 ) ;
218- expect ( identity2 ) . toEqual ( {
219- id : samlId2 ,
220- email : email2 ,
221- } ) ;
222- } ) ;
223144 } ) ;
224145
225146} ) ;
0 commit comments