Skip to content

Commit f5358aa

Browse files
committed
donotmerge: temp disable flag for bugbash
1 parent f996cbc commit f5358aa

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

packages/backend/src/graphql/__tests__/mutations/upsert-flow-collaborator.itest.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { 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

45
import { BadUserInputError } from '@/errors/graphql-errors'
56
import upsertFlowCollaborator from '@/graphql/mutations/upsert-flow-collaborator'
@@ -15,13 +16,13 @@ import Context from '@/types/express/context'
1516

1617
import { 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

2627
describe('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
})

packages/backend/src/graphql/mutations/upsert-flow-collaborator.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { addFlowTableConnection } from '@/helpers/add-flow-connection'
55
import { getOrCreateUser } from '@/helpers/auth'
66
import { validateAndParseEmail } from '@/helpers/email-validator'
77
import { getConnectionDetails } from '@/helpers/get-shared-connection-details'
8-
import { getLdFlagValue } from '@/helpers/launch-darkly'
8+
// import { getLdFlagValue } from '@/helpers/launch-darkly'
99
import logger from '@/helpers/logger'
1010
import Flow from '@/models/flow'
1111
import FlowCollaborator from '@/models/flow-collaborators'
@@ -22,14 +22,14 @@ const upsertFlowCollaborator: MutationResolvers['upsertFlowCollaborator'] =
2222
}
2323

2424
// TODO (kevinkim-ogp): remove this once collaborators is released to all
25-
const collaboratorsFlag = await getLdFlagValue(
26-
'collaborators',
27-
context.currentUser.email,
28-
false,
29-
)
30-
if (!collaboratorsFlag) {
31-
throw new BadUserInputError(' You are not allowed to add collaborators.')
32-
}
25+
// const collaboratorsFlag = await getLdFlagValue(
26+
// 'collaborators',
27+
// context.currentUser.email,
28+
// false,
29+
// )
30+
// if (!collaboratorsFlag) {
31+
// throw new BadUserInputError(' You are not allowed to add collaborators.')
32+
// }
3333

3434
const validatedEmail = await validateAndParseEmail(email)
3535
if (!validatedEmail) {

0 commit comments

Comments
 (0)