Skip to content

Commit

Permalink
test(material/autocomplete): provide context for expected selections
Browse files Browse the repository at this point in the history
  • Loading branch information
cusher committed Nov 28, 2023
1 parent dfe7e62 commit 9d32da4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/material/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,9 @@ describe('MDC-based MatAutocomplete', () => {

expect(input.value).toBe('Oregon');
expect(stateCtrl.value).toEqual({code: 'OR', name: 'Oregon'});
expect(spy).toHaveBeenCalledTimes(2);
expect(spy)
.withContext(`Expected optionSelections to emit deselect previous and select new options.`)
.toHaveBeenCalledTimes(2);

subscription.unsubscribe();
}));
Expand Down Expand Up @@ -2605,7 +2607,9 @@ describe('MDC-based MatAutocomplete', () => {

expect(input.value).toBe('Oregon');
expect(stateCtrl.value).toEqual({code: 'OR', name: 'Oregon'});
expect(spy).toHaveBeenCalledTimes(2);
expect(spy)
.withContext(`Expected optionSelections to emit deselect previous and select new options.`)
.toHaveBeenCalledTimes(2);

subscription.unsubscribe();
}));
Expand Down Expand Up @@ -2672,7 +2676,9 @@ describe('MDC-based MatAutocomplete', () => {

expect(input.value).toBe('');
expect(stateCtrl.value).toBe(null);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy)
.withContext(`Expected optionSelections to emit deselected option.`)
.toHaveBeenCalledTimes(1);

subscription.unsubscribe();
}));
Expand Down

0 comments on commit 9d32da4

Please sign in to comment.