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.
This commit is contained in:
Paul Gschwendtner
2019-08-06 21:22:19 +02:00
committed by mmalerba
parent 725a2b3c5d
commit 92d95ef240
9 changed files with 11 additions and 11 deletions
@@ -95,7 +95,7 @@ function runTests() {
it('should focus and blur a button', async () => {
const button = await loader.getHarness(buttonHarness.with({text: 'Basic button'}));
expect(getActiveElementId()).not.toBe('basic');
await button.foucs();
await button.focus();
expect(getActiveElementId()).toBe('basic');
await button.blur();
expect(getActiveElementId()).not.toBe('basic');
@@ -56,7 +56,7 @@ export class MatButtonHarness extends ComponentHarness {
}
/** Focuses the button and returns a void promise that indicates when the action is complete. */
async foucs(): Promise<void> {
async focus(): Promise<void> {
return (await this.host()).focus();
}
@@ -56,7 +56,7 @@ export class MatButtonHarness extends ComponentHarness {
}
/** Focuses the button and returns a void promise that indicates when the action is complete. */
async foucs(): Promise<void> {
async focus(): Promise<void> {
return (await this.host()).focus();
}
@@ -128,13 +128,13 @@ function runTests() {
it('should focus checkbox', async () => {
const checkbox = await loader.getHarness(checkboxHarness.with({label: 'First'}));
expect(getActiveElementTagName()).not.toBe('input');
await checkbox.foucs();
await checkbox.focus();
expect(getActiveElementTagName()).toBe('input');
});
it('should blur checkbox', async () => {
const checkbox = await loader.getHarness(checkboxHarness.with({label: 'First'}));
await checkbox.foucs();
await checkbox.focus();
expect(getActiveElementTagName()).toBe('input');
await checkbox.blur();
expect(getActiveElementTagName()).not.toBe('input');
@@ -89,7 +89,7 @@ export class MatCheckboxHarness extends ComponentHarness {
}
/** Focuses the checkbox and returns a void promise that indicates when the action is complete. */
async foucs(): Promise<void> {
async focus(): Promise<void> {
return (await this._input()).focus();
}
@@ -89,7 +89,7 @@ export class MatCheckboxHarness extends ComponentHarness {
}
/** Focuses the checkbox and returns a void promise that indicates when the action is complete. */
async foucs(): Promise<void> {
async focus(): Promise<void> {
return (await this._input()).focus();
}
@@ -79,7 +79,7 @@ export class MatSlideToggleHarness extends ComponentHarness {
}
/** Focuses the slide-toggle and returns a void promise that indicates action completion. */
async foucs(): Promise<void> {
async focus(): Promise<void> {
return (await this._input()).focus();
}
@@ -120,13 +120,13 @@ function runTests() {
it('should focus slide-toggle', async () => {
const slideToggle = await loader.getHarness(slideToggleHarness.with({label: 'First'}));
expect(getActiveElementTagName()).not.toBe('input');
await slideToggle.foucs();
await slideToggle.focus();
expect(getActiveElementTagName()).toBe('input');
});
it('should blur slide-toggle', async () => {
const slideToggle = await loader.getHarness(slideToggleHarness.with({label: 'First'}));
await slideToggle.foucs();
await slideToggle.focus();
expect(getActiveElementTagName()).toBe('input');
await slideToggle.blur();
expect(getActiveElementTagName()).not.toBe('input');
@@ -79,7 +79,7 @@ export class MatSlideToggleHarness extends ComponentHarness {
}
/** Focuses the slide-toggle and returns a void promise that indicates action completion. */
async foucs(): Promise<void> {
async focus(): Promise<void> {
return (await this._input()).focus();
}