From 92d95ef240cf2e2070b79f9a2f7ac70d766e1987 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 6 Aug 2019 21:22:19 +0200 Subject: [PATCH] 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. --- .../mdc-button/harness/button-harness.spec.ts | 2 +- .../mdc-button/harness/button-harness.ts | 2 +- .../mdc-button/harness/mdc-button-harness.ts | 2 +- .../mdc-checkbox/harness/checkbox-harness.spec.ts | 4 ++-- .../mdc-checkbox/harness/checkbox-harness.ts | 2 +- .../mdc-checkbox/harness/mdc-checkbox-harness.ts | 2 +- .../mdc-slide-toggle/harness/mdc-slide-toggle-harness.ts | 2 +- .../mdc-slide-toggle/harness/slide-toggle-harness.spec.ts | 4 ++-- .../mdc-slide-toggle/harness/slide-toggle-harness.ts | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/material-experimental/mdc-button/harness/button-harness.spec.ts b/src/material-experimental/mdc-button/harness/button-harness.spec.ts index 94b708c10b6..d8564079750 100644 --- a/src/material-experimental/mdc-button/harness/button-harness.spec.ts +++ b/src/material-experimental/mdc-button/harness/button-harness.spec.ts @@ -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'); diff --git a/src/material-experimental/mdc-button/harness/button-harness.ts b/src/material-experimental/mdc-button/harness/button-harness.ts index 967b7041037..4d1b75947e9 100644 --- a/src/material-experimental/mdc-button/harness/button-harness.ts +++ b/src/material-experimental/mdc-button/harness/button-harness.ts @@ -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 { + async focus(): Promise { return (await this.host()).focus(); } diff --git a/src/material-experimental/mdc-button/harness/mdc-button-harness.ts b/src/material-experimental/mdc-button/harness/mdc-button-harness.ts index bad557612e8..6c599a66f14 100644 --- a/src/material-experimental/mdc-button/harness/mdc-button-harness.ts +++ b/src/material-experimental/mdc-button/harness/mdc-button-harness.ts @@ -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 { + async focus(): Promise { return (await this.host()).focus(); } diff --git a/src/material-experimental/mdc-checkbox/harness/checkbox-harness.spec.ts b/src/material-experimental/mdc-checkbox/harness/checkbox-harness.spec.ts index 1b0c1809e06..e0bf3aec68c 100644 --- a/src/material-experimental/mdc-checkbox/harness/checkbox-harness.spec.ts +++ b/src/material-experimental/mdc-checkbox/harness/checkbox-harness.spec.ts @@ -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'); diff --git a/src/material-experimental/mdc-checkbox/harness/checkbox-harness.ts b/src/material-experimental/mdc-checkbox/harness/checkbox-harness.ts index 6d52da66e03..38aaea50e07 100644 --- a/src/material-experimental/mdc-checkbox/harness/checkbox-harness.ts +++ b/src/material-experimental/mdc-checkbox/harness/checkbox-harness.ts @@ -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 { + async focus(): Promise { return (await this._input()).focus(); } diff --git a/src/material-experimental/mdc-checkbox/harness/mdc-checkbox-harness.ts b/src/material-experimental/mdc-checkbox/harness/mdc-checkbox-harness.ts index f1f4b9c2c07..a110b256208 100644 --- a/src/material-experimental/mdc-checkbox/harness/mdc-checkbox-harness.ts +++ b/src/material-experimental/mdc-checkbox/harness/mdc-checkbox-harness.ts @@ -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 { + async focus(): Promise { return (await this._input()).focus(); } diff --git a/src/material-experimental/mdc-slide-toggle/harness/mdc-slide-toggle-harness.ts b/src/material-experimental/mdc-slide-toggle/harness/mdc-slide-toggle-harness.ts index 1320b071e2a..9cff45770a6 100644 --- a/src/material-experimental/mdc-slide-toggle/harness/mdc-slide-toggle-harness.ts +++ b/src/material-experimental/mdc-slide-toggle/harness/mdc-slide-toggle-harness.ts @@ -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 { + async focus(): Promise { return (await this._input()).focus(); } diff --git a/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.spec.ts b/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.spec.ts index 549869b5e82..f7629eb778b 100644 --- a/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.spec.ts +++ b/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.spec.ts @@ -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'); diff --git a/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.ts b/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.ts index 59d7b4bc708..78e80ba2351 100644 --- a/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.ts +++ b/src/material-experimental/mdc-slide-toggle/harness/slide-toggle-harness.ts @@ -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 { + async focus(): Promise { return (await this._input()).focus(); }