Skip to content

Commit ee1e101

Browse files
committed
Eliminate final duplicate - use setupAnimationAndCheckStaticDiff helper
1 parent 0652aa6 commit ee1e101

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

packages/amazonq/test/unit/lsp/chat/diffAnimation/diffAnimationController.test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ describe('DiffAnimationController', function () {
7171
assert.strictEqual(animationData, undefined)
7272
}
7373

74+
// Helper function to setup animation and check static diff status
75+
async function setupAnimationAndCheckStaticDiff(filePath: string, originalContent: string, newContent: string) {
76+
await setupAnimation(filePath, originalContent, newContent)
77+
const result = controller.isShowingStaticDiff(filePath)
78+
assert.strictEqual(typeof result, 'boolean')
79+
}
80+
7481
beforeEach(function () {
7582
sandbox = sinon.createSandbox()
7683

@@ -348,15 +355,7 @@ describe('DiffAnimationController', function () {
348355
})
349356

350357
it('should return correct static diff status', async function () {
351-
const filePath = '/test/file.js'
352-
const originalContent = 'original'
353-
const newContent = 'new'
354-
355-
setupStandardMocks(originalContent)
356-
await controller.startDiffAnimation(filePath, originalContent, newContent, false)
357-
358-
const result = controller.isShowingStaticDiff(filePath)
359-
assert.strictEqual(typeof result, 'boolean')
358+
await setupAnimationAndCheckStaticDiff('/test/file.js', 'original', 'new')
360359
})
361360
})
362361

0 commit comments

Comments
 (0)