Skip to content

Commit

Permalink
add type for test window
Browse files Browse the repository at this point in the history
  • Loading branch information
iOvergaard committed Feb 7, 2024
1 parent a872493 commit 59aa15b
Show file tree
Hide file tree
Showing 78 changed files with 157 additions and 155 deletions.
4 changes: 2 additions & 2 deletions apps/auth/src/login.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, fixture, html } from '@open-wc/testing';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import UmbLoginElement from './login.element.js';

describe('UmbLogin', () => {
Expand All @@ -13,7 +13,7 @@ describe('UmbLogin', () => {
expect(element).to.be.instanceOf(UmbLoginElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/consent/installer-content.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerConsentElement } from './installer-consent.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerConsentElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerConsentElement', () => {
expect(element).to.be.instanceOf(UmbInstallerConsentElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/database/installer-database.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerDatabaseElement } from './installer-database.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerDatabaseElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerDatabaseElement', () => {
expect(element).to.be.instanceOf(UmbInstallerDatabaseElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/error/installer-error.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerErrorElement } from './installer-error.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerErrorElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerErrorElement', () => {
expect(element).to.be.instanceOf(UmbInstallerErrorElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/installer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerElement } from './installer.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerElement', () => {
expect(element).to.be.instanceOf(UmbInstallerElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/installing/installer-installing.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerInstallingElement } from './installer-installing.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerInstallingElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerInstallingElement', () => {
expect(element).to.be.instanceOf(UmbInstallerInstallingElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/shared/layout/installer-layout.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerLayoutElement } from './installer-layout.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerLayoutElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerLayoutElement', () => {
expect(element).to.be.instanceOf(UmbInstallerLayoutElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/installer/user/installer-user.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbInstallerUserElement } from './installer-user.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// TODO: Write tests
describe('UmbInstallerUserElement', () => {
Expand All @@ -15,7 +15,7 @@ describe('UmbInstallerUserElement', () => {
expect(element).to.be.instanceOf(UmbInstallerUserElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/apps/upgrader/upgrader-view.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';

import { UmbUpgraderViewElement } from './upgrader-view.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

describe('UmbUpgraderView', () => {
let element: UmbUpgraderViewElement;
Expand All @@ -14,7 +14,7 @@ describe('UmbUpgraderView', () => {
expect(element).to.be.instanceOf(UmbUpgraderViewElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbPropertyEditorUIBlockGridElement } from './property-editor-ui-block-grid.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

describe('UmbPropertyEditorUIBlockGridElement', () => {
let element: UmbPropertyEditorUIBlockGridElement;
Expand All @@ -13,7 +13,7 @@ describe('UmbPropertyEditorUIBlockGridElement', () => {
expect(element).to.be.instanceOf(UmbPropertyEditorUIBlockGridElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbPropertyEditorUIBlockGridTypeConfigurationElement } from './property-editor-ui-block-grid-type-configuration.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

describe('UmbPropertyEditorUIBlockGridBlockConfigurationElement', () => {
let element: UmbPropertyEditorUIBlockGridTypeConfigurationElement;
Expand All @@ -15,7 +15,7 @@ describe('UmbPropertyEditorUIBlockGridBlockConfigurationElement', () => {
expect(element).to.be.instanceOf(UmbPropertyEditorUIBlockGridTypeConfigurationElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbPropertyEditorUIBlockListElement } from './property-editor-ui-block-list.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

describe('UmbPropertyEditorUIBlockListElement', () => {
let element: UmbPropertyEditorUIBlockListElement;
Expand All @@ -13,7 +13,7 @@ describe('UmbPropertyEditorUIBlockListElement', () => {
expect(element).to.be.instanceOf(UmbPropertyEditorUIBlockListElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbPropertyEditorUIBlockListBlockConfigurationElement } from './property-editor-ui-block-list-type-configuration.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

describe('UmbPropertyEditorUIBlockListBlockConfigurationElement', () => {
let element: UmbPropertyEditorUIBlockListBlockConfigurationElement;
Expand All @@ -15,7 +15,7 @@ describe('UmbPropertyEditorUIBlockListBlockConfigurationElement', () => {
expect(element).to.be.instanceOf(UmbPropertyEditorUIBlockListBlockConfigurationElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbInputBlockTypeElement } from './input-block-type.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
describe('UmbInputMediaElement', () => {
let element: UmbInputBlockTypeElement;

Expand All @@ -12,7 +12,7 @@ describe('UmbInputMediaElement', () => {
expect(element).to.be.instanceOf(UmbInputBlockTypeElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbPropertyEditorUIBlockGridGroupConfigurationElement } from './property-editor-ui-block-type-group-configuration.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

describe('UmbPropertyEditorUIBlockGridGroupConfigurationElement', () => {
let element: UmbPropertyEditorUIBlockGridGroupConfigurationElement;
Expand All @@ -15,7 +15,7 @@ describe('UmbPropertyEditorUIBlockGridGroupConfigurationElement', () => {
expect(element).to.be.instanceOf(UmbPropertyEditorUIBlockGridGroupConfigurationElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbExtensionSlotElement } from './extension-slot.element.js';
import { customElement } from '@umbraco-cms/backoffice/external/lit';
import type { ManifestDashboard} from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestDashboard } from '@umbraco-cms/backoffice/extension-registry';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbExtensionElementInitializer } from '@umbraco-cms/backoffice/extension-api';

Expand All @@ -28,7 +28,7 @@ describe('UmbExtensionSlotElement', () => {

/*
// This test fails offen on FireFox, there is no real need for this test. So i have chosen to skip it.
if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/packages/core/components/input-color/input-color.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbInputColorElement } from './input-color.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
describe('UmbInputColorElement', () => {
let element: UmbInputColorElement;

Expand All @@ -12,7 +12,7 @@ describe('UmbInputColorElement', () => {
expect(element).to.be.instanceOf(UmbInputColorElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
4 changes: 2 additions & 2 deletions src/packages/core/components/input-date/input-date.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbInputDateElement } from './input-date.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
describe('UmbInputDateElement', () => {
let element: UmbInputDateElement;

Expand All @@ -12,7 +12,7 @@ describe('UmbInputDateElement', () => {
expect(element).to.be.instanceOf(UmbInputDateElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbInputDropdownListElement } from './input-dropdown-list.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
describe('UmbInputDateElement', () => {
let element: UmbInputDropdownListElement;

Expand All @@ -12,7 +12,7 @@ describe('UmbInputDateElement', () => {
expect(element).to.be.instanceOf(UmbInputDropdownListElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbInputEyeDropperElement } from './input-eye-dropper.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
describe('UmbInputEyeDropperElement', () => {
let element: UmbInputEyeDropperElement;

Expand All @@ -12,7 +12,7 @@ describe('UmbInputEyeDropperElement', () => {
expect(element).to.be.instanceOf(UmbInputEyeDropperElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbInputNumberRangeElement } from './input-number-range.element.js';
import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
describe('UmbPropertyEditorUINumberRangeElement', () => {
let element: UmbInputNumberRangeElement;

Expand All @@ -12,7 +12,7 @@ describe('UmbPropertyEditorUINumberRangeElement', () => {
expect(element).to.be.instanceOf(UmbInputNumberRangeElement);
});

if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';
//TODO: Test has been commented out while we figure out how to setup import maps for the test environment
// import { UmbPickerSectionElement } from './picker-section.element.js';
// import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
// import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// describe('UmbPickerSectionElement', () => {
// let element: UmbPickerSectionElement;
Expand All @@ -13,7 +13,7 @@ import { expect, fixture, html } from '@open-wc/testing';
// expect(element).to.be.instanceOf(UmbPickerSectionElement);
// });

// if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
// if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
// it('passes the a11y audit', async () => {
// await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
// });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// import { expect, fixture, html } from '@open-wc/testing';
// import { UmbIconPickerModalElement } from './icon-picker-modal.element.js';
// import { defaultA11yConfig } from '@umbraco-cms/internal/test-utils';
// import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils';

// describe('umb-icon-picker-modal', () => {
// let element: UmbIconPickerModalElement;
Expand All @@ -13,7 +13,7 @@
// expect(element).to.be.instanceOf(UmbIconPickerModalElement);
// });

// if ((window as any).__UMBRACO_TEST_RUN_A11Y_TEST) {
// if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) {
// // TODO: Reinstate this test when the a11y audit is fixed on uui-color-picker
// // it('passes the a11y audit', async () => {
// // await expect(element).shadowDom.to.be.accessible(defaultA11yConfig);
Expand Down
Loading

0 comments on commit 59aa15b

Please sign in to comment.