11import { randomUUID } from 'crypto'
2- import { beforeEach , describe , expect , it , vi } from 'vitest'
2+ // import { beforeEach, describe, expect, it, vi } from 'vitest'
3+ import { beforeEach , describe , expect , it } from 'vitest'
34
45import { BadUserInputError } from '@/errors/graphql-errors'
56import upsertFlowCollaborator from '@/graphql/mutations/upsert-flow-collaborator'
@@ -15,13 +16,13 @@ import Context from '@/types/express/context'
1516
1617import { generateMockContext } from './tiles/table.mock'
1718
18- const mocks = vi . hoisted ( ( ) => ( {
19- getLdFlagValue : vi . fn ( ) . mockResolvedValue ( true ) ,
20- } ) )
19+ // const mocks = vi.hoisted(() => ({
20+ // getLdFlagValue: vi.fn().mockResolvedValue(true),
21+ // }))
2122
22- vi . mock ( '@/helpers/launch-darkly' , ( ) => ( {
23- getLdFlagValue : mocks . getLdFlagValue ,
24- } ) )
23+ // vi.mock('@/helpers/launch-darkly', () => ({
24+ // getLdFlagValue: mocks.getLdFlagValue,
25+ // }))
2526
2627describe ( 'upsert flow collaborator' , ( ) => {
2728 let context : Context
@@ -649,16 +650,16 @@ describe('upsert flow collaborator', () => {
649650 } )
650651 } )
651652
652- it ( 'should not allow adding collaborators if collaborators flag is false' , async ( ) => {
653- mocks . getLdFlagValue . mockResolvedValue ( false )
654- await expect (
655- upsertFlowCollaborator (
656- null ,
657- {
658- input : { flowId : dummyFlow . id , email : editor . email , role : 'editor' } ,
659- } ,
660- context ,
661- ) ,
662- ) . rejects . toThrow ( BadUserInputError )
663- } )
653+ // it('should not allow adding collaborators if collaborators flag is false', async () => {
654+ // mocks.getLdFlagValue.mockResolvedValue(false)
655+ // await expect(
656+ // upsertFlowCollaborator(
657+ // null,
658+ // {
659+ // input: { flowId: dummyFlow.id, email: editor.email, role: 'editor' },
660+ // },
661+ // context,
662+ // ),
663+ // ).rejects.toThrow(BadUserInputError)
664+ // })
664665} )
0 commit comments