Fixed failing test

The "document" package needed to be imported at runtime.
This commit is contained in:
leekelleher
2024-07-08 10:11:01 +01:00
parent 9b5a6872c8
commit 8dab8e12ed
2 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
import type { UmbContentPickerSource } from '../../types.js';
import { css, html, customElement, property, state } from '@umbraco-cms/backoffice/external/lit';
import { css, html, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { UmbReferenceByUniqueAndType } from '@umbraco-cms/backoffice/models';
@@ -13,7 +13,7 @@ const elementName = 'umb-input-content';
export class UmbInputContentElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
UmbLitElement,
) {
@property({ type: Object, attribute: false })
@property()
public set type(newType: UmbContentPickerSource['type']) {
const oldType = this.#type;
if (newType?.toLowerCase() !== this.#type) {

View File

@@ -1,11 +1,15 @@
import { UmbInputContentElement } from './input-content.element.js';
import { expect, fixture, html } from '@open-wc/testing';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import type { UmbTestRunnerWindow } from '@umbraco-cms/internal/test-utils';
import '@umbraco-cms/backoffice/document';
describe('UmbInputContentElement', () => {
let element: UmbInputContentElement;
beforeEach(async () => {
element = await fixture(html` <umb-input-content></umb-input-content> `);
element = await fixture(html`<umb-input-content></umb-input-content>`);
});
it('is defined with its own instance', () => {