fix: use html & unsafeStatic from @open-wc/testing
This commit is contained in:
parent
a2c66cd94d
commit
c4562f7e64
30 changed files with 140 additions and 102 deletions
17
.changeset/few-books-provide.md
Normal file
17
.changeset/few-books-provide.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
'@lion/button': patch
|
||||
'@lion/combobox': patch
|
||||
'@lion/core': patch
|
||||
'@lion/dialog': patch
|
||||
'@lion/form': patch
|
||||
'@lion/form-core': patch
|
||||
'@lion/form-integrations': patch
|
||||
'@lion/input': patch
|
||||
'@lion/listbox': patch
|
||||
'@lion/localize': patch
|
||||
'@lion/overlays': patch
|
||||
'@lion/select-rich': patch
|
||||
'@lion/tooltip': patch
|
||||
---
|
||||
|
||||
use html & unsafeStatic from @open-wc/testing instead of directly from lit
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
"providence-analytics": patch
|
||||
'providence-analytics': patch
|
||||
---
|
||||
|
||||
Correct default target in Windows if no -t
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
/* eslint-disable lit-a11y/click-events-have-key-events */
|
||||
import { browserDetection } from '@lion/core';
|
||||
import { aTimeout, expect, fixture, oneEvent, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { LionButton } from '@lion/button';
|
||||
import sinon from 'sinon';
|
||||
import { browserDetection } from '@lion/core';
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
expect,
|
||||
fixture,
|
||||
html,
|
||||
oneEvent,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
|
||||
export function LionButtonSuite({ klass = LionButton } = {}) {
|
||||
const tagStringButton = defineCE(class extends klass {});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
/* eslint-disable lit-a11y/click-events-have-key-events */
|
||||
import { aTimeout, expect, fixture, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { LionButtonReset } from '@lion/button';
|
||||
import sinon from 'sinon';
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import { aTimeout, defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
|
||||
export function LionButtonResetSuite({ klass = LionButtonReset } = {}) {
|
||||
const tagStringButtonReset = defineCE(class extends klass {});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
/* eslint-disable lit-a11y/click-events-have-key-events */
|
||||
import { aTimeout, expect, fixture, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { sendKeys } from '@web/test-runner-commands';
|
||||
import { LionButtonSubmit } from '@lion/button';
|
||||
import sinon from 'sinon';
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import { aTimeout, defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import { sendKeys } from '@web/test-runner-commands';
|
||||
import sinon from 'sinon';
|
||||
|
||||
export function LionButtonSubmitSuite({ klass = LionButtonSubmit } = {}) {
|
||||
const tagStringButton = defineCE(class extends klass {});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import '@lion/listbox/define-option';
|
||||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import sinon from 'sinon';
|
||||
import '@lion/combobox/define';
|
||||
import { browserDetection, LitElement } from '@lion/core';
|
||||
import { getListboxMembers } from '@lion/listbox/test-helpers';
|
||||
import { Required } from '@lion/form-core';
|
||||
import '@lion/listbox/define-option';
|
||||
import { getListboxMembers } from '@lion/listbox/test-helpers';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { LionCombobox } from '../src/LionCombobox.js';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { defineCE, expect, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { LitElement } from '../index.js';
|
||||
import { DelegateMixin } from '../src/DelegateMixin.js';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { expect, fixture as _fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { expect, fixture as _fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import { runOverlayMixinSuite } from '../../overlays/test-suites/OverlayMixin.suite.js';
|
||||
import '@lion/dialog/define';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { parseDate } from '@lion/localize';
|
||||
import { aTimeout, defineCE, expect, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { aTimeout, defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { FormatMixin } from '../src/FormatMixin.js';
|
||||
import { Unparseable, Validator } from '../index.js';
|
||||
import { FormatMixin } from '../src/FormatMixin.js';
|
||||
import { getFormControlMembers } from '../test-helpers/getFormControlMembers.js';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { LionInput } from '@lion/input';
|
||||
import '@lion/fieldset/define';
|
||||
import { FormGroupMixin, Required } from '@lion/form-core';
|
||||
import { expect, fixture, fixtureSync } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { LionInput } from '@lion/input';
|
||||
import { expect, fixture, fixtureSync, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { ChoiceGroupMixin } from '../../src/choice-group/ChoiceGroupMixin.js';
|
||||
import { ChoiceInputMixin } from '../../src/choice-group/ChoiceInputMixin.js';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { localizeTearDown } from '@lion/localize/test-helpers';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { defineCE, expect, fixture } from '@open-wc/testing';
|
||||
import '@lion/form-core/define';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
import { LionInput } from '@lion/input';
|
||||
import '@lion/form-core/define';
|
||||
import { localizeTearDown } from '@lion/localize/test-helpers';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import { FormGroupMixin } from '../../src/form-group/FormGroupMixin.js';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
import { LitElement, ifDefined } from '@lion/core';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { localizeTearDown } from '@lion/localize/test-helpers';
|
||||
import { defineCE, expect, triggerFocusFor, fixture, aTimeout } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { IsNumber, Validator, LionField } from '@lion/form-core';
|
||||
import { ifDefined, LitElement } from '@lion/core';
|
||||
import { IsNumber, LionField, Validator } from '@lion/form-core';
|
||||
import '@lion/form-core/define';
|
||||
import { localizeTearDown } from '@lion/localize/test-helpers';
|
||||
import {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
expect,
|
||||
fixture,
|
||||
html,
|
||||
triggerFocusFor,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { FormGroupMixin } from '../../src/form-group/FormGroupMixin.js';
|
||||
import { getFormControlMembers } from '../../test-helpers/getFormControlMembers.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { defineCE, expect, fixture, oneEvent } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { defineCE, expect, fixture, html, oneEvent, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { FocusMixin } from '../src/FocusMixin.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { expect, defineCE, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { LitElement } from '@lion/core';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { FormControlMixin } from '../src/FormControlMixin.js';
|
||||
import { FormRegistrarMixin } from '../src/registration/FormRegistrarMixin.js';
|
||||
import { FocusMixin } from '../src/FocusMixin.js';
|
||||
import { FormGroupMixin } from '../src/form-group/FormGroupMixin.js';
|
||||
import { FormControlMixin } from '../src/FormControlMixin.js';
|
||||
import { FormRegistrarMixin } from '../src/registration/FormRegistrarMixin.js';
|
||||
|
||||
/**
|
||||
* @typedef {import('../types/FormControlMixinTypes').FormControlHost} FormControlHost
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
import { unsafeHTML } from '@lion/core';
|
||||
import { Required, Validator } from '@lion/form-core';
|
||||
import '@lion/form-core/define-field';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
import { localize } from '@lion/localize';
|
||||
import { localizeTearDown } from '@lion/localize/test-helpers';
|
||||
import { Required, Validator } from '@lion/form-core';
|
||||
import { expect, fixture, triggerBlurFor, triggerFocusFor } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
import {
|
||||
expect,
|
||||
fixture,
|
||||
html,
|
||||
triggerBlurFor,
|
||||
triggerFocusFor,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import '@lion/form-core/define-field';
|
||||
|
||||
/**
|
||||
* @typedef {import('../src/LionField.js').LionField} LionField
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { defineCE, expect, fixture, fixtureSync } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { defineCE, expect, fixture, fixtureSync, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { SyncUpdatableMixin } from '../../src/utils/SyncUpdatableMixin.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { LionField } from '@lion/form-core';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import { Required } from '../../src/validate/validators/Required.js';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { defineCE, expect, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { ValidateMixin } from '../../src/validate/ValidateMixin.js';
|
||||
import { Validator } from '../../src/validate/Validator.js';
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { expect, fixture, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { Required, DefaultSuccess, Validator } from '@lion/form-core';
|
||||
import { DefaultSuccess, Required, Validator } from '@lion/form-core';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
import { LionInput } from '@lion/input';
|
||||
import { localize } from '@lion/localize';
|
||||
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
|
||||
import { LionInput } from '@lion/input';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { getFormControlMembers } from '@lion/form-core/test-helpers';
|
||||
|
||||
describe('Form Validation Integrations', () => {
|
||||
const lightDom = '';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { expect, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import sinon from 'sinon';
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
import { expect, fixture as _fixture, oneEvent, aTimeout, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { spy } from 'sinon';
|
||||
import { LionField } from '@lion/form-core';
|
||||
import { LionFieldset } from '@lion/fieldset';
|
||||
import '@lion/form-core/define';
|
||||
import '@lion/fieldset/define';
|
||||
|
||||
import { LionField } from '@lion/form-core';
|
||||
import '@lion/form-core/define';
|
||||
import '@lion/form/define';
|
||||
import {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
expect,
|
||||
fixture as _fixture,
|
||||
html,
|
||||
oneEvent,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
import { spy } from 'sinon';
|
||||
|
||||
/**
|
||||
|
||||
* @typedef {import('../src/LionForm').LionForm} LionForm
|
||||
* @typedef {import('@lion/core').TemplateResult} TemplateResult
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { Validator } from '@lion/form-core';
|
||||
import { expect, fixture, triggerFocusFor, aTimeout } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { getInputMembers } from '../test-helpers/index.js';
|
||||
import '@lion/input/define';
|
||||
import { aTimeout, expect, fixture, html, triggerFocusFor, unsafeStatic } from '@open-wc/testing';
|
||||
import { getInputMembers } from '../test-helpers/index.js';
|
||||
|
||||
/**
|
||||
* @typedef {import('../src/LionInput').LionInput} LionInput
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
import { LitElement, repeat } from '@lion/core';
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import { repeat, LitElement } from '@lion/core';
|
||||
import { Required } from '@lion/form-core';
|
||||
import { LionOptions } from '@lion/listbox';
|
||||
import '@lion/listbox/define';
|
||||
import { expect, aTimeout, nextFrame, fixture as _fixture, defineCE } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
expect,
|
||||
fixture as _fixture,
|
||||
html,
|
||||
nextFrame,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { getListboxMembers } from '../test-helpers/index.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
import { isDirectiveResult, LitElement } from '@lion/core';
|
||||
import { aTimeout, defineCE, expect, fixture, fixtureSync, nextFrame } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
expect,
|
||||
fixture,
|
||||
fixtureSync,
|
||||
html,
|
||||
nextFrame,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
import sinon from 'sinon';
|
||||
import { localize } from '../src/localize.js';
|
||||
import { LocalizeMixin } from '../src/LocalizeMixin.js';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, fixture, html, nextFrame, aTimeout } from '@open-wc/testing';
|
||||
|
||||
import sinon from 'sinon';
|
||||
import { overlays } from '../src/overlays.js';
|
||||
import { OverlayController } from '../src/OverlayController.js';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
/* eslint-disable no-new */
|
||||
import { aTimeout, defineCE, expect, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import { aTimeout, defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import { fixtureSync } from '@open-wc/testing-helpers';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import { OverlayController } from '../src/OverlayController.js';
|
||||
import { overlays } from '../src/overlays.js';
|
||||
import { keyCodes } from '../src/utils/key-codes.js';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { defineCE } from '@open-wc/testing';
|
||||
import { unsafeStatic } from 'lit/static-html.js';
|
||||
import { defineCE, unsafeStatic } from '@open-wc/testing';
|
||||
import { LitElement, html } from '@lion/core';
|
||||
import { runOverlayMixinSuite } from '../test-suites/OverlayMixin.suite.js';
|
||||
import { OverlayMixin } from '../src/OverlayMixin.js';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import { OverlayMixin } from '@lion/overlays';
|
||||
import { LitElement } from '@lion/core';
|
||||
import { defineCE, fixture, expect } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import '@lion/listbox/define';
|
||||
import { OverlayMixin } from '@lion/overlays';
|
||||
import '@lion/select-rich/define';
|
||||
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
|
||||
/**
|
||||
* @typedef {import('../src/LionSelectRich').LionSelectRich} LionSelectRich
|
||||
|
|
|
|||
|
|
@ -1,15 +1,22 @@
|
|||
import { LitElement } from '@lion/core';
|
||||
import { renderLitAsNode } from '@lion/helpers';
|
||||
import { OverlayController } from '@lion/overlays';
|
||||
import { LionOption } from '@lion/listbox';
|
||||
import { mimicClick } from '@lion/overlays/test-helpers';
|
||||
import { aTimeout, defineCE, expect, nextFrame, fixture as _fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { LionSelectInvoker, LionSelectRich } from '@lion/select-rich';
|
||||
import '@lion/core/differentKeyEventNamesShimIE';
|
||||
import { renderLitAsNode } from '@lion/helpers';
|
||||
import { LionOption } from '@lion/listbox';
|
||||
import '@lion/listbox/define';
|
||||
import '@lion/select-rich/define';
|
||||
import { getListboxMembers } from '@lion/listbox/test-helpers';
|
||||
import { OverlayController } from '@lion/overlays';
|
||||
import { mimicClick } from '@lion/overlays/test-helpers';
|
||||
import { LionSelectInvoker, LionSelectRich } from '@lion/select-rich';
|
||||
import '@lion/select-rich/define';
|
||||
import {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
expect,
|
||||
fixture as _fixture,
|
||||
html,
|
||||
nextFrame,
|
||||
unsafeStatic,
|
||||
} from '@open-wc/testing';
|
||||
|
||||
/**
|
||||
* @typedef {import('@lion/listbox/src/LionOptions').LionOptions} LionOptions
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { aTimeout, expect, fixture } from '@open-wc/testing';
|
||||
import { html, unsafeStatic } from 'lit/static-html.js';
|
||||
import { runOverlayMixinSuite } from '../../overlays/test-suites/OverlayMixin.suite.js';
|
||||
import '@lion/tooltip/define';
|
||||
import { aTimeout, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
|
||||
import { runOverlayMixinSuite } from '../../overlays/test-suites/OverlayMixin.suite.js';
|
||||
|
||||
/**
|
||||
* @typedef {import('../src/LionTooltip.js').LionTooltip} LionTooltip
|
||||
|
|
|
|||
Loading…
Reference in a new issue