Skip to content

Commit 92d95ef

Browse files
devversionmmalerba
authored andcommitted
fix(material-experimental): typo in harness focus methods (#16673)
Fixes a typo for the `focus` method in most of the available test harnesses. Apparently a single instance of that typo has spread across all other harnesses due to copy and paste.
1 parent 725a2b3 commit 92d95ef

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

src/material-experimental/mdc-button/harness/button-harness.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function runTests() {
9595
it('should focus and blur a button', async () => {
9696
const button = await loader.getHarness(buttonHarness.with({text: 'Basic button'}));
9797
expect(getActiveElementId()).not.toBe('basic');
98-
await button.foucs();
98+
await button.focus();
9999
expect(getActiveElementId()).toBe('basic');
100100
await button.blur();
101101
expect(getActiveElementId()).not.toBe('basic');

src/material-experimental/mdc-button/harness/button-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class MatButtonHarness extends ComponentHarness {
5656
}
5757

5858
/** Focuses the button and returns a void promise that indicates when the action is complete. */
59-
async foucs(): Promise<void> {
59+
async focus(): Promise<void> {
6060
return (await this.host()).focus();
6161
}
6262

src/material-experimental/mdc-button/harness/mdc-button-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class MatButtonHarness extends ComponentHarness {
5656
}
5757

5858
/** Focuses the button and returns a void promise that indicates when the action is complete. */
59-
async foucs(): Promise<void> {
59+
async focus(): Promise<void> {
6060
return (await this.host()).focus();
6161
}
6262

src/material-experimental/mdc-checkbox/harness/checkbox-harness.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ function runTests() {
128128
it('should focus checkbox', async () => {
129129
const checkbox = await loader.getHarness(checkboxHarness.with({label: 'First'}));
130130
expect(getActiveElementTagName()).not.toBe('input');
131-
await checkbox.foucs();
131+
await checkbox.focus();
132132
expect(getActiveElementTagName()).toBe('input');
133133
});
134134

135135
it('should blur checkbox', async () => {
136136
const checkbox = await loader.getHarness(checkboxHarness.with({label: 'First'}));
137-
await checkbox.foucs();
137+
await checkbox.focus();
138138
expect(getActiveElementTagName()).toBe('input');
139139
await checkbox.blur();
140140
expect(getActiveElementTagName()).not.toBe('input');

src/material-experimental/mdc-checkbox/harness/checkbox-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class MatCheckboxHarness extends ComponentHarness {
8989
}
9090

9191
/** Focuses the checkbox and returns a void promise that indicates when the action is complete. */
92-
async foucs(): Promise<void> {
92+
async focus(): Promise<void> {
9393
return (await this._input()).focus();
9494
}
9595

src/material-experimental/mdc-checkbox/harness/mdc-checkbox-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class MatCheckboxHarness extends ComponentHarness {
8989
}
9090

9191
/** Focuses the checkbox and returns a void promise that indicates when the action is complete. */
92-
async foucs(): Promise<void> {
92+
async focus(): Promise<void> {
9393
return (await this._input()).focus();
9494
}
9595

src/material-experimental/mdc-slide-toggle/harness/mdc-slide-toggle-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class MatSlideToggleHarness extends ComponentHarness {
7979
}
8080

8181
/** Focuses the slide-toggle and returns a void promise that indicates action completion. */
82-
async foucs(): Promise<void> {
82+
async focus(): Promise<void> {
8383
return (await this._input()).focus();
8484
}
8585

src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ function runTests() {
120120
it('should focus slide-toggle', async () => {
121121
const slideToggle = await loader.getHarness(slideToggleHarness.with({label: 'First'}));
122122
expect(getActiveElementTagName()).not.toBe('input');
123-
await slideToggle.foucs();
123+
await slideToggle.focus();
124124
expect(getActiveElementTagName()).toBe('input');
125125
});
126126

127127
it('should blur slide-toggle', async () => {
128128
const slideToggle = await loader.getHarness(slideToggleHarness.with({label: 'First'}));
129-
await slideToggle.foucs();
129+
await slideToggle.focus();
130130
expect(getActiveElementTagName()).toBe('input');
131131
await slideToggle.blur();
132132
expect(getActiveElementTagName()).not.toBe('input');

src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class MatSlideToggleHarness extends ComponentHarness {
7979
}
8080

8181
/** Focuses the slide-toggle and returns a void promise that indicates action completion. */
82-
async foucs(): Promise<void> {
82+
async focus(): Promise<void> {
8383
return (await this._input()).focus();
8484
}
8585

0 commit comments

Comments
 (0)