Skip to content

Commit

Permalink
build: fix unformatted files (angular#24231)
Browse files Browse the repository at this point in the history
The formatting CI check only verifies changed files which means that some failures snuck in when we merged a passing commit after them. I also fixed a couple of deprecated signature usages in tests.
  • Loading branch information
crisbeto committed Jan 19, 2022
1 parent c489f37 commit 70120bd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
9 changes: 6 additions & 3 deletions src/cdk/a11y/focus-monitor/focus-monitor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,14 @@ describe('FocusMonitor', () => {
flush();

expect(buttonElement.classList.length)
.withContext('button should have exactly 2 focus classes').toBe(2);
.withContext('button should have exactly 2 focus classes')
.toBe(2);
expect(buttonElement.classList.contains('cdk-focused'))
.withContext('button should have cdk-focused class').toBe(true);
.withContext('button should have cdk-focused class')
.toBe(true);
expect(buttonElement.classList.contains('cdk-keyboard-focused'))
.withContext('button should have cdk-keyboard-focused class').toBe(true);
.withContext('button should have cdk-keyboard-focused class')
.toBe(true);
expect(changeHandler).toHaveBeenCalledWith('keyboard');
}));

Expand Down
2 changes: 1 addition & 1 deletion src/cdk/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDes
this._customRowDefs,
this._customHeaderRowDefs,
this._customFooterRowDefs,
this._columnDefsByName
this._columnDefsByName,
].forEach(def => {
def.clear();
});
Expand Down
15 changes: 7 additions & 8 deletions src/material-experimental/mdc-autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,8 @@ describe('MDC-based MatAutocomplete', () => {
it('should not interfere with the ENTER key when pressing a modifier', fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;

expect(input.value).toBeFalsy('Expected input to start off blank.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to start off open.');
expect(input.value).withContext('Expected input to start off blank.').toBeFalsy();
expect(trigger.panelOpen).withContext('Expected panel to start off open.').toBe(true);

fixture.componentInstance.trigger._handleKeydown(DOWN_ARROW_EVENT);
flush();
Expand All @@ -1099,12 +1099,11 @@ describe('MDC-based MatAutocomplete', () => {
fixture.componentInstance.trigger._handleKeydown(ENTER_EVENT);
fixture.detectChanges();

expect(trigger.panelOpen).toBe(true, 'Expected panel to remain open.');
expect(input.value).toBeFalsy('Expected input to remain blank.');
expect(ENTER_EVENT.defaultPrevented).toBe(
false,
'Expected the default ENTER action not to have been prevented.',
);
expect(trigger.panelOpen).withContext('Expected panel to remain open.').toBe(true);
expect(input.value).withContext('Expected input to remain blank.').toBeFalsy();
expect(ENTER_EVENT.defaultPrevented)
.withContext('Expected the default ENTER action not to have been prevented.')
.toBe(false);
}));

it('should fill the text field, not select an option, when SPACE is entered', () => {
Expand Down
15 changes: 7 additions & 8 deletions src/material/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,8 @@ describe('MatAutocomplete', () => {
it('should not interfere with the ENTER key when pressing a modifier', fakeAsync(() => {
const trigger = fixture.componentInstance.trigger;

expect(input.value).toBeFalsy('Expected input to start off blank.');
expect(trigger.panelOpen).toBe(true, 'Expected panel to start off open.');
expect(input.value).withContext('Expected input to start off blank.').toBeFalsy();
expect(trigger.panelOpen).withContext('Expected panel to start off open.').toBe(true);

fixture.componentInstance.trigger._handleKeydown(DOWN_ARROW_EVENT);
flush();
Expand All @@ -1095,12 +1095,11 @@ describe('MatAutocomplete', () => {
fixture.componentInstance.trigger._handleKeydown(ENTER_EVENT);
fixture.detectChanges();

expect(trigger.panelOpen).toBe(true, 'Expected panel to remain open.');
expect(input.value).toBeFalsy('Expected input to remain blank.');
expect(ENTER_EVENT.defaultPrevented).toBe(
false,
'Expected the default ENTER action not to have been prevented.',
);
expect(trigger.panelOpen).withContext('Expected panel to remain open.').toBe(true);
expect(input.value).withContext('Expected input to remain blank.').toBeFalsy();
expect(ENTER_EVENT.defaultPrevented)
.withContext('Expected the default ENTER action not to have been prevented.')
.toBe(false);
}));

it('should fill the text field, not select an option, when SPACE is entered', () => {
Expand Down
1 change: 0 additions & 1 deletion src/material/select/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,6 @@ describe('MatSelect', () => {
expect(fixture.componentInstance.control.value).toBe('pizza-1');
expect(fixture.componentInstance.select.value).toBe('pizza-1');
}));

});

describe('with custom trigger', () => {
Expand Down

0 comments on commit 70120bd

Please sign in to comment.