diff --git a/.changeset/chilly-poets-march.md b/.changeset/chilly-poets-march.md new file mode 100644 index 000000000..78135f19b --- /dev/null +++ b/.changeset/chilly-poets-march.md @@ -0,0 +1,6 @@ +--- +'@lion/core': minor +'@lion/calendar': minor +--- + +Remove keyboardEventShimIE test helper diff --git a/packages/calendar/test/lion-calendar.test.js b/packages/calendar/test/lion-calendar.test.js index 7fa259fe6..9b3788ea4 100644 --- a/packages/calendar/test/lion-calendar.test.js +++ b/packages/calendar/test/lion-calendar.test.js @@ -1,5 +1,4 @@ import { html } from '@lion/core'; -import '@lion/core/test-helpers'; import { localize } from '@lion/localize'; import { localizeTearDown } from '@lion/localize/test-helpers'; import { expect, fixture as _fixture } from '@open-wc/testing'; diff --git a/packages/core/package.json b/packages/core/package.json index e91fccdf6..ad7b59ff7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -19,7 +19,6 @@ "docs", "src", "test", - "test-helpers", "translations", "types" ], @@ -48,7 +47,6 @@ }, "exports": { ".": "./index.js", - "./test-helpers": "./test-helpers/index.js", "./closestPolyfill": "./src/closestPolyfill.js", "./docs/*": "./docs/*" } diff --git a/packages/core/test-helpers/index.js b/packages/core/test-helpers/index.js deleted file mode 100644 index db30d4fee..000000000 --- a/packages/core/test-helpers/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './keyboardEventShimIE.js'; diff --git a/packages/core/test-helpers/keyboardEventShimIE.js b/packages/core/test-helpers/keyboardEventShimIE.js deleted file mode 100644 index 45e834217..000000000 --- a/packages/core/test-helpers/keyboardEventShimIE.js +++ /dev/null @@ -1,49 +0,0 @@ -if (typeof window.KeyboardEvent !== 'function') { - // e.g. is IE and needs "polyfill" - const KeyboardEvent = (event, _params) => { - // current spec for it https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent - const params = { - bubbles: false, - cancelable: false, - view: document.defaultView, - key: false, - location: false, - ctrlKey: false, - shiftKey: false, - altKey: false, - metaKey: false, - repeat: false, - ..._params, - }; - const modifiersListArray = []; - if (params.ctrlKey) { - modifiersListArray.push('Control'); - } - if (params.shiftKey) { - modifiersListArray.push('Shift'); - } - if (params.altKey) { - modifiersListArray.push('Alt'); - } - if (params.metaKey) { - modifiersListArray.push('Meta'); - } - - const ev = document.createEvent('KeyboardEvent'); - // IE Spec for it https://technet.microsoft.com/en-us/windows/ff975297(v=vs.60) - ev.initKeyboardEvent( - event, - params.bubbles, - params.cancelable, - params.view, - params.key, - params.location, - modifiersListArray.join(' '), - params.repeat ? 1 : 0, - params.locale, - ); - return ev; - }; - KeyboardEvent.prototype = window.Event.prototype; - window.KeyboardEvent = KeyboardEvent; -}