Skip to content

Commit 9be42fc

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
test(slack): align historical auth fixtures with CI rules
1 parent 898c726 commit 9be42fc

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎apps/sim/lib/workflows/compatibility/slack-v2-auth.test.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { omit } from '@sim/utils/object'
66
import type { BlockState, WorkflowState } from '@sim/workflow-types/workflow'
7-
import { afterAll, describe, expect, it, vi } from 'vitest'
7+
import { afterAll, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest'
88

99
vi.unmock('@/blocks/registry')
1010

@@ -16,7 +16,10 @@ import * as blocksBarrel from '@/blocks'
1616
import { getBlock as getRealBlock } from '@/blocks/registry'
1717
import { extractBlockParams } from '@/serializer'
1818

19-
const getBlockSpy = vi.spyOn(blocksBarrel, 'getBlock').mockImplementation(getRealBlock)
19+
let getBlockSpy: MockInstance<typeof blocksBarrel.getBlock>
20+
beforeEach(() => {
21+
getBlockSpy = vi.spyOn(blocksBarrel, 'getBlock').mockImplementation(getRealBlock)
22+
})
2023

2124
afterAll(() => {
2225
getBlockSpy.mockRestore()
@@ -71,7 +74,13 @@ describe('projectLegacySlackV2Auth', () => {
7174

7275
it('honors the historical custom-bot and OAuth modes', () => {
7376
const historical = createHistoricalSlackV2Block()
74-
historical.data!.canonicalModes!.botCredential = 'advanced'
77+
historical.data = {
78+
...historical.data,
79+
canonicalModes: {
80+
...historical.data?.canonicalModes,
81+
botCredential: 'advanced',
82+
},
83+
}
7584
historical.subBlocks.manualCustomBotCredential.value = 'credential-manual-bot'
7685

7786
const projected = projectLegacySlackV2Auth({ [historical.id]: historical })[historical.id]

0 commit comments

Comments
 (0)