Skip to content

fix(material/autocomplete): typos and unresolved variables in tests #29532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2024
Merged
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
16 changes: 8 additions & 8 deletions src/material/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('MDC-based MatAutocomplete', () => {
.toEqual('');
}));

it('should close the panel when the user clicks away via auxilliary button', waitForAsync(async () => {
it('should close the panel when the user clicks away via auxiliary button', waitForAsync(async () => {
dispatchFakeEvent(input, 'focusin');
fixture.detectChanges();
await new Promise(r => setTimeout(r));
Expand Down Expand Up @@ -1609,7 +1609,7 @@ describe('MDC-based MatAutocomplete', () => {
fixture.detectChanges();

expect(event.defaultPrevented)
.withContext(`Expected autocompete not to block ${name} key`)
.withContext(`Expected autocomplete not to block ${name} key`)
.toBe(false);
});
});
Expand Down Expand Up @@ -3440,7 +3440,7 @@ describe('MDC-based MatAutocomplete', () => {
widthFixture.detectChanges();

const overlayPane = overlayContainerElement.querySelector('.cdk-overlay-pane') as HTMLElement;
// Firefox, edge return a decimal value for width, so we need to parse and round it to verify
// Firefox, Edge return a decimal value for width, so we need to parse and round it to verify
expect(Math.ceil(parseFloat(overlayPane.style.width as string))).toBe(300);

widthFixture.componentInstance.trigger.closePanel();
Expand All @@ -3453,7 +3453,7 @@ describe('MDC-based MatAutocomplete', () => {
widthFixture.componentInstance.trigger.openPanel();
widthFixture.detectChanges();

// Firefox, edge return a decimal value for width, so we need to parse and round it to verify
// Firefox, Edge return a decimal value for width, so we need to parse and round it to verify
expect(Math.ceil(parseFloat(overlayPane.style.width as string))).toBe(500);
});

Expand Down Expand Up @@ -3850,7 +3850,7 @@ describe('MDC-based MatAutocomplete', () => {
dispatchFakeEvent(document.querySelector('mat-option')!, 'click');
fixture.detectChanges();

const selectedOption = document.querySelector('mat-option[aria-selected="true"');
const selectedOption = document.querySelector('mat-option[aria-selected="true"]');
expect(selectedOption).withContext('Expected an option to be selected.').not.toBeNull();
expect(selectedOption?.querySelector('.mat-pseudo-checkbox.mat-pseudo-checkbox-minimal'))
.withContext(
Expand All @@ -3876,7 +3876,7 @@ describe('MDC-based MatAutocomplete', () => {
dispatchFakeEvent(document.querySelector('mat-option')!, 'click');
fixture.detectChanges();

const selectedOption = document.querySelector('mat-option[aria-selected="true"');
const selectedOption = document.querySelector('mat-option[aria-selected="true"]');
expect(selectedOption).withContext('Expected an option to be selected.').not.toBeNull();
expect(document.querySelectorAll('.mat-pseudo-checkbox').length).toBe(0);
});
Expand Down Expand Up @@ -4212,7 +4212,7 @@ class AutocompleteWithoutPanel {

<mat-autocomplete #auto="matAutocomplete">
@for (group of stateGroups; track group) {
<mat-optgroup [label]="group.label">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label does not exist in group. There is a title instead.

<mat-optgroup [label]="group.title">
@for (state of group.states; track state) {
<mat-option [value]="state">
<span>{{ state }}</span>
Expand Down Expand Up @@ -4251,7 +4251,7 @@ class AutocompleteWithGroups {
<mat-autocomplete #auto="matAutocomplete">
@if (true) {
@for (group of stateGroups; track group) {
<mat-optgroup [label]="group.label">
<mat-optgroup [label]="group.title">
@for (state of group.states; track state) {
<mat-option [value]="state">
<span>{{ state }}</span>
Expand Down
Loading