Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed

- Change the differences log to contain the diff between the 2 results.

## [1.79.0] - 2025-09-24

### Changed
Expand Down
25 changes: 21 additions & 4 deletions node/services/autocomplete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,27 @@ describe('fetchAutocompleteSuggestions', () => {
).toHaveBeenCalledWith({
query: 'test',
})
expect(ctx.vtex.logger.error).toHaveBeenCalledWith({
message: 'Autocomplete Suggestions: Results differ',
params: JSON.stringify({ query: 'test' }),
})
expect(ctx.vtex.logger.error).toHaveBeenCalledWith(
expect.objectContaining({
message: 'Autocomplete Suggestions: Results differ',
params: JSON.stringify({ query: 'test' }),
differenceCount: 6,
differences: expect.arrayContaining([
expect.objectContaining({
path: 'searches',
type: 'array_length_mismatch',
expected: 1,
actual: 4,
}),
expect.objectContaining({
path: 'searches[0].term',
type: 'different_value',
expected: 'test',
actual: 'camisa feminina',
}),
]),
})
)
expect(response).toEqual(result)
})

Expand Down
Loading
Loading