@@ -196,37 +196,6 @@ describe('query userExperiences', () => {
196196 expect ( res . data . userExperiences . edges ) . toHaveLength ( 1 ) ;
197197 } ) ;
198198
199- it ( 'should restrict fields for anonymous users to only allowed columns' , async ( ) => {
200- loggedUser = null ;
201-
202- const res = await client . query ( USER_EXPERIENCES_QUERY , {
203- variables : { userId : '1' } ,
204- } ) ;
205-
206- expect ( res . errors ) . toBeFalsy ( ) ;
207- expect ( res . data . userExperiences . edges ) . toHaveLength ( 1 ) ;
208-
209- const experience = res . data . userExperiences . edges [ 0 ] . node ;
210-
211- // Allowed columns for anonymous users
212- expect ( experience ) . toMatchObject ( {
213- id : 'f47ac10b-58cc-4372-a567-0e02b2c3d479' ,
214- type : 'work' ,
215- title : 'Senior Software Engineer' ,
216- company : {
217- id : 'company-1' ,
218- name : 'Daily.dev' ,
219- } ,
220- } ) ;
221-
222- // Restricted columns should be null for anonymous users
223- expect ( experience . subtitle ) . toBeNull ( ) ;
224- expect ( experience . description ) . toBeNull ( ) ;
225- expect ( experience . startedAt ) . toBeNull ( ) ;
226- expect ( experience . endedAt ) . toBeNull ( ) ;
227- expect ( experience . createdAt ) . toBeNull ( ) ;
228- } ) ;
229-
230199 it ( 'should return all fields for logged-in users' , async ( ) => {
231200 loggedUser = '1' ;
232201
@@ -515,35 +484,6 @@ describe('query userExperienceById', () => {
515484 } ) ;
516485 } ) ;
517486
518- it ( 'should restrict fields for anonymous users when fetching by id' , async ( ) => {
519- loggedUser = null ;
520-
521- const res = await client . query ( USER_EXPERIENCE_BY_ID_QUERY , {
522- variables : { id : 'f47ac10b-58cc-4372-a567-0e02b2c3d479' } ,
523- } ) ;
524-
525- expect ( res . errors ) . toBeFalsy ( ) ;
526-
527- const experience = res . data . userExperienceById ;
528-
529- // Allowed columns for anonymous users
530- expect ( experience ) . toMatchObject ( {
531- id : 'f47ac10b-58cc-4372-a567-0e02b2c3d479' ,
532- type : 'work' ,
533- title : 'Senior Software Engineer' ,
534- company : {
535- name : 'Daily.dev' ,
536- } ,
537- } ) ;
538-
539- // Restricted columns should be null for anonymous users
540- expect ( experience . subtitle ) . toBeNull ( ) ;
541- expect ( experience . description ) . toBeNull ( ) ;
542- expect ( experience . startedAt ) . toBeNull ( ) ;
543- expect ( experience . endedAt ) . toBeNull ( ) ;
544- expect ( experience . createdAt ) . toBeNull ( ) ;
545- } ) ;
546-
547487 it ( 'should return experience from another user' , async ( ) => {
548488 loggedUser = '1' ;
549489
0 commit comments