Skip to content

Commit

Permalink
build: fix formatting failure (#24466)
Browse files Browse the repository at this point in the history
Fixes a couple of files that weren't formatted and are breaking the lint check.

(cherry picked from commit 6d8693d)
  • Loading branch information
crisbeto committed Feb 23, 2022
1 parent 6b76469 commit 4fd7ce4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
25 changes: 12 additions & 13 deletions src/material-experimental/mdc-autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1396,23 +1396,22 @@ describe('MDC-based MatAutocomplete', () => {
.toBeFalsy();
}));

it('should not close when a click event occurs on the outside while the panel has focus',
fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;
it('should not close when a click event occurs on the outside while the panel has focus', fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;

input.focus();
flush();
fixture.detectChanges();
input.focus();
flush();
fixture.detectChanges();

expect(document.activeElement).toBe(input, 'Expected input to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to be open.');
expect(document.activeElement).toBe(input, 'Expected input to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to be open.');

dispatchMouseEvent(document.body, 'click');
fixture.detectChanges();
dispatchMouseEvent(document.body, 'click');
fixture.detectChanges();

expect(document.activeElement).toBe(input, 'Expected input to continue to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to stay open.');
}));
expect(document.activeElement).toBe(input, 'Expected input to continue to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to stay open.');
}));

it('should reset the active option when closing with the escape key', fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;
Expand Down
25 changes: 12 additions & 13 deletions src/material/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,23 +1379,22 @@ describe('MatAutocomplete', () => {
.toBeFalsy();
}));

it('should not close when a click event occurs on the outside while the panel has focus',
fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;
it('should not close when a click event occurs on the outside while the panel has focus', fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;

input.focus();
flush();
fixture.detectChanges();
input.focus();
flush();
fixture.detectChanges();

expect(document.activeElement).toBe(input, 'Expected input to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to be open.');
expect(document.activeElement).toBe(input, 'Expected input to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to be open.');

dispatchMouseEvent(document.body, 'click');
fixture.detectChanges();
dispatchMouseEvent(document.body, 'click');
fixture.detectChanges();

expect(document.activeElement).toBe(input, 'Expected input to continue to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to stay open.');
}));
expect(document.activeElement).toBe(input, 'Expected input to continue to be focused.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to stay open.');
}));

it('should reset the active option when closing with the escape key', fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;
Expand Down

0 comments on commit 4fd7ce4

Please sign in to comment.