test(backoffice): fix host type in extension-initializer-base test
The `loaded`-signal test (added in #23167) built its host with `UmbControllerHostElementMixin(HTMLElement)`, mirroring the older `UmbBaseExtensionInitializer` tests. But `UmbExtensionInitializerBase` requires a full `UmbElement` host, so the test failed `tsc` (TS2345) under the root tsconfig. The product build excludes `*.test.ts`, so it slipped through CI but breaks `npm run compile`/the editor. Use `UmbElementMixin(HTMLElement)`, matching what production callers pass (app/backoffice/preview elements are all UmbElements). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9f633416b1
commit
a14b908574
+5
-5
@@ -4,13 +4,13 @@ import { loadManifestPlainJs } from '../functions/load-manifest-plain-js.functio
|
||||
import { UmbExtensionInitializerBase } from './extension-initializer-base.js';
|
||||
import { UmbObserver } from '../../observable-api/observer.js';
|
||||
import { expect, fixture } from '@open-wc/testing';
|
||||
import { UmbControllerHostElementMixin } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
||||
import type { UmbElement } from '@umbraco-cms/backoffice/element-api';
|
||||
import { customElement, html } from '@umbraco-cms/backoffice/external/lit';
|
||||
|
||||
@customElement('umb-test-initializer-base-host')
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
class UmbTestInitializerBaseHostElement extends UmbControllerHostElementMixin(HTMLElement) {}
|
||||
class UmbTestInitializerBaseHostElement extends UmbElementMixin(HTMLElement) {}
|
||||
|
||||
async function wait(ms: number) {
|
||||
await new Promise((r) => setTimeout(r, ms));
|
||||
@@ -20,7 +20,7 @@ async function wait(ms: number) {
|
||||
// `observe` callback fires synchronously during `super()` — before any subclass field would
|
||||
// initialise — so the record of instantiated aliases is a closed-over array created up front
|
||||
// rather than instance state.
|
||||
function createTestInitializer(host: UmbControllerHostElement, registry: UmbExtensionRegistry<ManifestBase>) {
|
||||
function createTestInitializer(host: UmbElement, registry: UmbExtensionRegistry<ManifestBase>) {
|
||||
const instantiated: string[] = [];
|
||||
class UmbTestInitializer extends UmbExtensionInitializerBase<'test'> {
|
||||
constructor() {
|
||||
@@ -41,7 +41,7 @@ function createTestInitializer(host: UmbControllerHostElement, registry: UmbExte
|
||||
}
|
||||
|
||||
describe('UmbExtensionInitializerBase — loaded signal', () => {
|
||||
let hostElement: UmbControllerHostElement;
|
||||
let hostElement: UmbElement;
|
||||
|
||||
beforeEach(async () => {
|
||||
hostElement = await fixture(html`<umb-test-initializer-base-host></umb-test-initializer-base-host>`);
|
||||
|
||||
Reference in New Issue
Block a user