Skip to content

Commit

Permalink
feat(auto-edits): add test case for setting context
Browse files Browse the repository at this point in the history
  • Loading branch information
hitesh-1997 committed Jan 10, 2025
1 parent 496f539 commit 18f3951
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions vscode/src/autoedits/autoedits-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,25 @@ describe('AutoeditsProvider', () => {
]
`)
})

it('do not set the the cody.supersuggest.active context for inline completion items', async () => {
const prediction = 'const x = 1\n'
await autoeditResultFor('const x = █\n', { prediction })
expect(executedCommands).toMatchInlineSnapshot([])

Check failure on line 346 in vscode/src/autoedits/autoedits-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 20)

src/autoedits/autoedits-provider.test.ts > AutoeditsProvider > do not set the the cody.supersuggest.active context for inline completion items

Error: Snapshot `AutoeditsProvider > do not set the the cody.supersuggest.active context for inline completion items 1` mismatched ❯ src/autoedits/autoedits-provider.test.ts:346:34

Check failure on line 346 in vscode/src/autoedits/autoedits-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (windows, 20)

src/autoedits/autoedits-provider.test.ts > AutoeditsProvider > do not set the the cody.supersuggest.active context for inline completion items

Error: Snapshot `AutoeditsProvider > do not set the the cody.supersuggest.active context for inline completion items 1` mismatched ❯ src/autoedits/autoedits-provider.test.ts:346:34

Check failure on line 346 in vscode/src/autoedits/autoedits-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 18)

src/autoedits/autoedits-provider.test.ts > AutoeditsProvider > do not set the the cody.supersuggest.active context for inline completion items

Error: Snapshot `AutoeditsProvider > do not set the the cody.supersuggest.active context for inline completion items 1` mismatched ❯ src/autoedits/autoedits-provider.test.ts:346:34
})

it('set the cody.supersuggest.active context for inline decoration items', async () => {
const prediction = 'const a = 1\n'
await autoeditResultFor('const x = █\n', { prediction })
expect(executedCommands).toMatchInlineSnapshot(

Check failure on line 352 in vscode/src/autoedits/autoedits-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 20)

src/autoedits/autoedits-provider.test.ts > AutoeditsProvider > set the cody.supersuggest.active context for inline decoration items

Error: Snapshot `AutoeditsProvider > set the cody.supersuggest.active context for inline decoration items 1` mismatched ❯ src/autoedits/autoedits-provider.test.ts:352:34

Check failure on line 352 in vscode/src/autoedits/autoedits-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (windows, 20)

src/autoedits/autoedits-provider.test.ts > AutoeditsProvider > set the cody.supersuggest.active context for inline decoration items

Error: Snapshot `AutoeditsProvider > set the cody.supersuggest.active context for inline decoration items 1` mismatched ❯ src/autoedits/autoedits-provider.test.ts:352:34

Check failure on line 352 in vscode/src/autoedits/autoedits-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 18)

src/autoedits/autoedits-provider.test.ts > AutoeditsProvider > set the cody.supersuggest.active context for inline decoration items

Error: Snapshot `AutoeditsProvider > set the cody.supersuggest.active context for inline decoration items 1` mismatched ❯ src/autoedits/autoedits-provider.test.ts:352:34
expect.arrayContaining([['setContext', 'cody.supersuggest.active', true]])
)
await acceptSuggestionCommand()

// Deactive the context after accepting the suggestion
expect(executedCommands.length).toBe(3)
expect(executedCommands[1]).toMatchInlineSnapshot(
expect.arrayContaining(['setContext', 'cody.supersuggest.active', false])
)
})
})

0 comments on commit 18f3951

Please sign in to comment.