From 31a754c90405ac3a21858cdd038d56aa7375fabc Mon Sep 17 00:00:00 2001 From: Miles Malerba Date: Wed, 17 Aug 2022 10:00:32 -0700 Subject: [PATCH] feat(material/table): pass `this` rather than concrete classes in the harnesses (#25482) some users are extending the harnesses, and passing the concrete class broke them --- src/material/legacy-table/testing/cell-harness.ts | 6 +++--- src/material/table/testing/cell-harness.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/material/legacy-table/testing/cell-harness.ts b/src/material/legacy-table/testing/cell-harness.ts index f56ed9da7a57..acced9bbe2f5 100644 --- a/src/material/legacy-table/testing/cell-harness.ts +++ b/src/material/legacy-table/testing/cell-harness.ts @@ -20,7 +20,7 @@ export class MatLegacyCellHarness extends _MatCellHarnessBase { * @return a `HarnessPredicate` configured with the given options. */ static with(options: CellHarnessFilters = {}): HarnessPredicate { - return _MatCellHarnessBase._getCellPredicate(MatLegacyCellHarness, options); + return _MatCellHarnessBase._getCellPredicate(this, options); } } @@ -36,7 +36,7 @@ export class MatLegacyHeaderCellHarness extends _MatCellHarnessBase { * @return a `HarnessPredicate` configured with the given options. */ static with(options: CellHarnessFilters = {}): HarnessPredicate { - return _MatCellHarnessBase._getCellPredicate(MatLegacyHeaderCellHarness, options); + return _MatCellHarnessBase._getCellPredicate(this, options); } } @@ -52,6 +52,6 @@ export class MatLegacyFooterCellHarness extends _MatCellHarnessBase { * @return a `HarnessPredicate` configured with the given options. */ static with(options: CellHarnessFilters = {}): HarnessPredicate { - return _MatCellHarnessBase._getCellPredicate(MatLegacyFooterCellHarness, options); + return _MatCellHarnessBase._getCellPredicate(this, options); } } diff --git a/src/material/table/testing/cell-harness.ts b/src/material/table/testing/cell-harness.ts index a8d6faac8a7a..fdc0b32b2836 100644 --- a/src/material/table/testing/cell-harness.ts +++ b/src/material/table/testing/cell-harness.ts @@ -64,7 +64,7 @@ export class MatCellHarness extends _MatCellHarnessBase { * @return a `HarnessPredicate` configured with the given options. */ static with(options: CellHarnessFilters = {}): HarnessPredicate { - return _MatCellHarnessBase._getCellPredicate(MatCellHarness, options); + return _MatCellHarnessBase._getCellPredicate(this, options); } } @@ -80,7 +80,7 @@ export class MatHeaderCellHarness extends _MatCellHarnessBase { * @return a `HarnessPredicate` configured with the given options. */ static with(options: CellHarnessFilters = {}): HarnessPredicate { - return _MatCellHarnessBase._getCellPredicate(MatHeaderCellHarness, options); + return _MatCellHarnessBase._getCellPredicate(this, options); } } @@ -96,6 +96,6 @@ export class MatFooterCellHarness extends _MatCellHarnessBase { * @return a `HarnessPredicate` configured with the given options. */ static with(options: CellHarnessFilters = {}): HarnessPredicate { - return _MatCellHarnessBase._getCellPredicate(MatFooterCellHarness, options); + return _MatCellHarnessBase._getCellPredicate(this, options); } }