diff --git a/libs/components/forms/testing/src/radio/radio-group-harness.ts b/libs/components/forms/testing/src/radio/radio-group-harness.ts index 211207ba6f..34bd547fbe 100644 --- a/libs/components/forms/testing/src/radio/radio-group-harness.ts +++ b/libs/components/forms/testing/src/radio/radio-group-harness.ts @@ -112,7 +112,14 @@ export class SkyRadioGroupHarness extends SkyComponentHarness { * Gets the help popover content. */ public async getHelpPopoverContent(): Promise { - return await (await this.#getHelpInline()).getPopoverContent(); + const content = await (await this.#getHelpInline()).getPopoverContent(); + + /* istanbul ignore if */ + if (typeof content === 'object') { + throw Error('Unexpected template ref'); + } + + return content; } /** diff --git a/libs/components/forms/testing/src/radio/radio-harness.ts b/libs/components/forms/testing/src/radio/radio-harness.ts index b8488cb8c0..ecfaee800b 100644 --- a/libs/components/forms/testing/src/radio/radio-harness.ts +++ b/libs/components/forms/testing/src/radio/radio-harness.ts @@ -86,7 +86,14 @@ export class SkyRadioHarness extends SkyComponentHarness { * Gets the help popover content. */ public async getHelpPopoverContent(): Promise { - return await (await this.#getHelpInline()).getPopoverContent(); + const content = await (await this.#getHelpInline()).getPopoverContent(); + + /* istanbul ignore if */ + if (typeof content === 'object') { + throw Error('Unexpected template ref'); + } + + return content; } /** diff --git a/libs/components/help-inline/testing/src/help-inline/help-inline-harness.ts b/libs/components/help-inline/testing/src/help-inline/help-inline-harness.ts index e2df6ecadb..4360f34544 100644 --- a/libs/components/help-inline/testing/src/help-inline/help-inline-harness.ts +++ b/libs/components/help-inline/testing/src/help-inline/help-inline-harness.ts @@ -1,4 +1,5 @@ import { HarnessPredicate } from '@angular/cdk/testing'; +import { TemplateRef } from '@angular/core'; import { SkyComponentHarness } from '@skyux/core/testing'; import { SkyPopoverContentHarness, @@ -104,7 +105,9 @@ export class SkyHelpInlineHarness extends SkyComponentHarness { /** * Gets the help popover content. */ - public async getPopoverContent(): Promise { + public async getPopoverContent(): Promise< + TemplateRef | string | undefined + > { return (await this.#getPopoverHarnessContent())?.getBodyText(); }