ctrl.show()}>
content
@@ -123,9 +115,7 @@ describe('Local Positioning', () => {
it('allows the user to override default Popper modifiers', async () => {
const ctrl = new OverlayController({
...withLocalTestConfig(),
- contentNode: fixtureSync(html`
-
`),
@@ -158,9 +148,7 @@ describe('Local Positioning', () => {
it('positions the Popper element correctly on show', async () => {
const ctrl = new OverlayController({
...withLocalTestConfig(),
- contentNode: fixtureSync(html`
-
`),
@@ -191,9 +179,7 @@ describe('Local Positioning', () => {
it.skip('updates placement properly even during hidden state', async () => {
const ctrl = new OverlayController({
...withLocalTestConfig(),
- contentNode: fixtureSync(html`
-
`),
@@ -242,9 +228,7 @@ describe('Local Positioning', () => {
it.skip('updates positioning correctly during shown state when config gets updated', async () => {
const ctrl = new OverlayController({
...withLocalTestConfig(),
- contentNode: fixtureSync(html`
-
ctrl.show()}>
Invoker
diff --git a/packages/remark-extend/README.md b/packages/remark-extend/README.md
index 0200fa995..5df0eb463 100644
--- a/packages/remark-extend/README.md
+++ b/packages/remark-extend/README.md
@@ -20,10 +20,7 @@ const { remarkExtend } = require('remark-extend');
const sourceMd = '# Headline';
const extendMd = 'extending instructions';
-const parser = unified()
- .use(markdown)
- .use(remarkExtend, { extendMd })
- .use(mdStringify);
+const parser = unified().use(markdown).use(remarkExtend, { extendMd }).use(mdStringify);
const result = await parser.process(sourceMd);
```
diff --git a/packages/remark-extend/test-node/remark-extend.test.js b/packages/remark-extend/test-node/remark-extend.test.js
index a4bf19035..bb2d664c3 100644
--- a/packages/remark-extend/test-node/remark-extend.test.js
+++ b/packages/remark-extend/test-node/remark-extend.test.js
@@ -242,10 +242,7 @@ describe('remarkExtend', () => {
'```',
].join('\n');
- const parser = unified()
- .use(markdown)
- .use(remarkExtend, { extendMd })
- .use(mdStringify);
+ const parser = unified().use(markdown).use(remarkExtend, { extendMd }).use(mdStringify);
await expectThrowsAsync(
() => parser.process(input),
diff --git a/packages/select-rich/src/LionSelectInvoker.js b/packages/select-rich/src/LionSelectInvoker.js
index 8dcbbe54f..7afd95f36 100644
--- a/packages/select-rich/src/LionSelectInvoker.js
+++ b/packages/select-rich/src/LionSelectInvoker.js
@@ -98,12 +98,6 @@ export class LionSelectInvoker extends LionButton {
// eslint-disable-next-line class-methods-use-this
_afterTemplate() {
- return html`
- ${!this.singleOption
- ? html`
-
- `
- : ''}
- `;
+ return html`${!this.singleOption ? html`
` : ''}`;
}
}
diff --git a/packages/select-rich/src/LionSelectRich.js b/packages/select-rich/src/LionSelectRich.js
index cfc60262f..bf711cffb 100644
--- a/packages/select-rich/src/LionSelectRich.js
+++ b/packages/select-rich/src/LionSelectRich.js
@@ -8,9 +8,7 @@ import './differentKeyNamesShimIE.js';
import { LionSelectInvoker } from './LionSelectInvoker.js';
function uuid() {
- return Math.random()
- .toString(36)
- .substr(2, 10);
+ return Math.random().toString(36).substr(2, 10);
}
function detectInteractionMode() {
diff --git a/packages/select-rich/src/differentKeyNamesShimIE.js b/packages/select-rich/src/differentKeyNamesShimIE.js
index 65b6d49d1..d03a623c6 100644
--- a/packages/select-rich/src/differentKeyNamesShimIE.js
+++ b/packages/select-rich/src/differentKeyNamesShimIE.js
@@ -23,7 +23,7 @@ if (descriptor) {
};
Object.defineProperty(event, 'key', {
// eslint-disable-next-line object-shorthand, func-names
- get: function() {
+ get: function () {
const key = descriptor.get.call(this);
// eslint-disable-next-line no-prototype-builtins
diff --git a/packages/select-rich/test/lion-option.test.js b/packages/select-rich/test/lion-option.test.js
index b9c3539e7..e049db09e 100644
--- a/packages/select-rich/test/lion-option.test.js
+++ b/packages/select-rich/test/lion-option.test.js
@@ -1,39 +1,28 @@
import { expect, fixture, html } from '@open-wc/testing';
import sinon from 'sinon';
-
import '../lion-option.js';
describe('lion-option', () => {
describe('Values', () => {
it('has a modelValue', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.modelValue).to.deep.equal({ value: 10, checked: false });
});
it('can be checked', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.modelValue).to.deep.equal({ value: 10, checked: true });
});
it('is hidden when attribute hidden is true', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html`
`);
expect(el).not.to.be.displayed;
});
});
describe('Accessibility', () => {
it('has the "option" role', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.getAttribute('role')).to.equal('option');
});
@@ -70,9 +59,7 @@ describe('lion-option', () => {
describe('State reflection', () => {
it('asynchronously adds the attribute "active" when active', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.active).to.equal(false);
expect(el.hasAttribute('active')).to.be.false;
@@ -90,9 +77,7 @@ describe('lion-option', () => {
});
it('does become checked on [click]', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.checked).to.be.false;
el.click();
await el.updateComplete;
@@ -112,18 +97,14 @@ describe('lion-option', () => {
describe('Disabled', () => {
it('does not becomes active on [mouseenter]', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.active).to.be.false;
el.dispatchEvent(new Event('mouseenter'));
expect(el.active).to.be.false;
});
it('does not become checked on [click]', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.checked).to.be.false;
el.click();
await el.updateComplete;
diff --git a/packages/select-rich/test/lion-select-invoker.test.js b/packages/select-rich/test/lion-select-invoker.test.js
index 4f1df75f4..d2277fbf0 100644
--- a/packages/select-rich/test/lion-select-invoker.test.js
+++ b/packages/select-rich/test/lion-select-invoker.test.js
@@ -1,21 +1,16 @@
-import { expect, fixture, html, defineCE } from '@open-wc/testing';
import { LionButton } from '@lion/button';
-import { LionSelectInvoker } from '../src/LionSelectInvoker.js';
-
+import { defineCE, expect, fixture, html } from '@open-wc/testing';
import '../lion-select-invoker.js';
+import { LionSelectInvoker } from '../src/LionSelectInvoker.js';
describe('lion-select-invoker', () => {
it('should behave as a button', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el instanceof LionButton).to.be.true;
});
it('renders invoker info based on selectedElement child elements', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
el.selectedElement = await fixture(`
`);
await el.updateComplete;
@@ -31,9 +26,7 @@ describe('lion-select-invoker', () => {
});
it('renders invoker info based on selectedElement textContent', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
el.selectedElement = await fixture(`
just textContent
`);
await el.updateComplete;
@@ -41,9 +34,7 @@ describe('lion-select-invoker', () => {
});
it('has tabindex="0"', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.tabIndex).to.equal(0);
expect(el.getAttribute('tabindex')).to.equal('0');
});
@@ -57,9 +48,7 @@ describe('lion-select-invoker', () => {
});
it('should render after slot when singleOption is not true', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.shadowRoot.querySelector('slot[name="after"]')).to.exist;
});
@@ -70,9 +59,7 @@ describe('lion-select-invoker', () => {
class extends LionSelectInvoker {
_contentTemplate() {
if (this.selectedElement && this.selectedElement.textContent === 'cat') {
- return html`
- cat selected
- `;
+ return html`cat selected `;
}
return `no valid selection`;
}
diff --git a/packages/select-rich/test/lion-select-rich.test.js b/packages/select-rich/test/lion-select-rich.test.js
index 27d3a2d56..d6d10a45a 100644
--- a/packages/select-rich/test/lion-select-rich.test.js
+++ b/packages/select-rich/test/lion-select-rich.test.js
@@ -37,9 +37,7 @@ describe('lion-select-rich', () => {
expect(el.formElements[0].name).to.equal('foo');
expect(el.formElements[1].name).to.equal('foo');
- const validChild = await fixture(html`
-
Item 3
- `);
+ const validChild = await fixture(html`
Item 3`);
el.appendChild(validChild);
expect(el.formElements[2].name).to.equal('foo');
@@ -56,9 +54,7 @@ describe('lion-select-rich', () => {
`);
await nextFrame();
- const invalidChild = await fixture(html`
-
- `);
+ const invalidChild = await fixture(html`
`);
expect(() => {
el.addFormElement(invalidChild);
@@ -816,9 +812,7 @@ describe('lion-select-rich', () => {
const invokerTagName = defineCE(
class extends LionSelectInvoker {
_noSelectionTemplate() {
- return html`
- Please select an option..
- `;
+ return html`Please select an option..`;
}
},
);
diff --git a/packages/steps/src/LionStep.js b/packages/steps/src/LionStep.js
index 9982d361e..c961cdd2d 100644
--- a/packages/steps/src/LionStep.js
+++ b/packages/steps/src/LionStep.js
@@ -1,4 +1,4 @@
-import { LitElement, html, css } from '@lion/core';
+import { css, html, LitElement } from '@lion/core';
/**
* `LionStep` is one of many in a LionSteps Controller
@@ -96,9 +96,7 @@ export class LionStep extends LitElement {
}
render() {
- return html`
-
- `;
+ return html`
`;
}
firstUpdated() {
diff --git a/packages/steps/src/LionSteps.js b/packages/steps/src/LionSteps.js
index c50802e88..0ba25ff69 100644
--- a/packages/steps/src/LionSteps.js
+++ b/packages/steps/src/LionSteps.js
@@ -1,4 +1,4 @@
-import { LitElement, html, css } from '@lion/core';
+import { css, html, LitElement } from '@lion/core';
/**
* `LionSteps` is a controller for a multi step system.
@@ -63,9 +63,7 @@ export class LionSteps extends LitElement {
}
render() {
- return html`
-
- `;
+ return html`
`;
}
firstUpdated() {
diff --git a/packages/steps/test/lion-steps.test.js b/packages/steps/test/lion-steps.test.js
index cd3aef18f..1ee6ac696 100644
--- a/packages/steps/test/lion-steps.test.js
+++ b/packages/steps/test/lion-steps.test.js
@@ -1,8 +1,7 @@
+import { expect, fixture, html, nextFrame, oneEvent } from '@open-wc/testing';
import sinon from 'sinon';
-import { expect, fixture, html, oneEvent, nextFrame } from '@open-wc/testing';
-
-import '../lion-steps.js';
import '../lion-step.js';
+import '../lion-steps.js';
async function checkWorkflow(steps, expected) {
return new Promise(resolve => {
@@ -28,18 +27,12 @@ async function checkWorkflow(steps, expected) {
describe('lion-steps', () => {
it('can be instantiated', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el).to.be.a('HTMLElement');
});
it('is hidden when attribute hidden is true', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html`
`);
expect(el).not.to.be.displayed;
});
diff --git a/packages/switch/src/LionSwitch.js b/packages/switch/src/LionSwitch.js
index b5f388cf5..c91eb6741 100644
--- a/packages/switch/src/LionSwitch.js
+++ b/packages/switch/src/LionSwitch.js
@@ -1,6 +1,6 @@
-import { html, css, ScopedElementsMixin } from '@lion/core';
-import { LionField } from '@lion/field';
import { ChoiceInputMixin } from '@lion/choice-input';
+import { css, html, ScopedElementsMixin } from '@lion/core';
+import { LionField } from '@lion/field';
import { LionSwitchButton } from './LionSwitchButton.js';
export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField)) {
@@ -49,15 +49,11 @@ export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField))
}
_groupOneTemplate() {
- return html`
- ${this._labelTemplate()} ${this._helpTextTemplate()} ${this._feedbackTemplate()}
- `;
+ return html`${this._labelTemplate()} ${this._helpTextTemplate()} ${this._feedbackTemplate()}`;
}
_groupTwoTemplate() {
- return html`
- ${this._inputGroupTemplate()}
- `;
+ return html`${this._inputGroupTemplate()}`;
}
connectedCallback() {
diff --git a/packages/switch/test/lion-switch-button.test.js b/packages/switch/test/lion-switch-button.test.js
index cfdd43af4..c02beca11 100644
--- a/packages/switch/test/lion-switch-button.test.js
+++ b/packages/switch/test/lion-switch-button.test.js
@@ -1,14 +1,11 @@
import { expect, fixture, html } from '@open-wc/testing';
import sinon from 'sinon';
-
import '../lion-switch-button.js';
describe('lion-switch-button', () => {
let el;
beforeEach(async () => {
- el = await fixture(html`
-
- `);
+ el = await fixture(html`
`);
});
it('should be focusable', () => {
diff --git a/packages/switch/test/lion-switch.test.js b/packages/switch/test/lion-switch.test.js
index 62e2e95a4..0c3982728 100644
--- a/packages/switch/test/lion-switch.test.js
+++ b/packages/switch/test/lion-switch.test.js
@@ -1,19 +1,14 @@
import { expect, fixture, html } from '@open-wc/testing';
-
import '../lion-switch.js';
describe('lion-switch', () => {
it('should have default "input" element', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(Array.from(el.children).find(child => child.slot === 'input')).not.to.be.false;
});
it('should sync its "disabled" state to child button', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el._inputNode.disabled).to.be.true;
expect(el._inputNode.hasAttribute('disabled')).to.be.true;
el.disabled = false;
@@ -23,21 +18,13 @@ describe('lion-switch', () => {
});
it('is hidden when attribute hidden is true', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html`
`);
expect(el).not.to.be.displayed;
});
it('should sync its "checked" state to child button', async () => {
- const uncheckedEl = await fixture(html`
-
- `);
- const checkedEl = await fixture(html`
-
- `);
+ const uncheckedEl = await fixture(html`
`);
+ const checkedEl = await fixture(html`
`);
expect(uncheckedEl._inputNode.checked).to.be.false;
expect(checkedEl._inputNode.checked).to.be.true;
uncheckedEl.checked = true;
@@ -49,9 +36,7 @@ describe('lion-switch', () => {
});
it('should sync "checked" state received from child button', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
const button = el._inputNode;
expect(el.checked).to.be.false;
button.click();
@@ -61,9 +46,7 @@ describe('lion-switch', () => {
});
it('synchronizes modelValue to checked state and vice versa', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.checked).to.be.false;
expect(el.modelValue).to.deep.equal({
checked: false,
@@ -78,9 +61,7 @@ describe('lion-switch', () => {
});
it('is submitted by default', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html`
`);
expect(el.submitted).to.be.true;
});
});
diff --git a/packages/tabs/src/LionTabs.js b/packages/tabs/src/LionTabs.js
index c879881cb..d861c82e1 100644
--- a/packages/tabs/src/LionTabs.js
+++ b/packages/tabs/src/LionTabs.js
@@ -1,9 +1,6 @@
-import { LitElement, css, html } from '@lion/core';
+import { css, html, LitElement } from '@lion/core';
-const uuid = () =>
- Math.random()
- .toString(36)
- .substr(2, 10);
+const uuid = () => Math.random().toString(36).substr(2, 10);
const setupPanel = ({ element, uid }) => {
element.setAttribute('id', `panel-${uid}`);
diff --git a/packages/textarea/test/lion-textarea.test.js b/packages/textarea/test/lion-textarea.test.js
index e87b52724..72abcbb75 100644
--- a/packages/textarea/test/lion-textarea.test.js
+++ b/packages/textarea/test/lion-textarea.test.js
@@ -1,5 +1,4 @@
import { expect, fixture, html } from '@open-wc/testing';
-
import '../lion-textarea.js';
function hasBrowserResizeSupport() {
@@ -58,9 +57,7 @@ describe('
', () => {
it('supports initial modelValue', async () => {
const el = await fixture(
- html`
-
- `,
+ html``,
);
expect(el.querySelector('textarea').value).to.equal('From value attribute');
});
@@ -101,11 +98,7 @@ describe('', () => {
});
it('stops growing after property "maxRows" is reached when there was an initial value', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html``);
return [4, 5, 6, 7, 8].reduce(async (heightPromise, i) => {
const oldHeight = await heightPromise;
@@ -126,18 +119,14 @@ describe('', () => {
});
it('stops shrinking after property "rows" is reached', async () => {
- const el = await fixture(html`
-
- `);
+ const el = await fixture(html``);
expect(el.scrollHeight).to.be.equal(el.clientHeight);
const oneRowHeight = el.clientHeight;
el.rows = 3;
el.resizeTextarea();
await el.updateComplete;
- expect(oneRowHeight)
- .to.be.below(el.clientHeight)
- .and.to.be.below(el.scrollHeight);
+ expect(oneRowHeight).to.be.below(el.clientHeight).and.to.be.below(el.scrollHeight);
});
it('has an attribute that can be used to set the placeholder text of the textarea', async () => {
diff --git a/packages/validate/src/LionValidationFeedback.js b/packages/validate/src/LionValidationFeedback.js
index ea175630a..bf767a040 100644
--- a/packages/validate/src/LionValidationFeedback.js
+++ b/packages/validate/src/LionValidationFeedback.js
@@ -42,11 +42,11 @@ export class LionValidationFeedback extends LitElement {
render() {
return html`
${this.feedbackData &&
- this.feedbackData.map(
- ({ message, type, validator }) => html`
- ${this._messageTemplate({ message, type, validator })}
- `,
- )}
+ this.feedbackData.map(
+ ({ message, type, validator }) => html`
+ ${this._messageTemplate({ message, type, validator })}
+ `,
+ )}
`;
}
}
diff --git a/packages/validate/test-suites/ValidateMixinFeedbackPart.suite.js b/packages/validate/test-suites/ValidateMixinFeedbackPart.suite.js
index fc845fe8e..1091e2f7d 100644
--- a/packages/validate/test-suites/ValidateMixinFeedbackPart.suite.js
+++ b/packages/validate/test-suites/ValidateMixinFeedbackPart.suite.js
@@ -1,12 +1,11 @@
-import { expect, fixture, html, unsafeStatic, defineCE } from '@open-wc/testing';
-import sinon from 'sinon';
import { LitElement } from '@lion/core';
import { localize } from '@lion/localize';
import { localizeTearDown } from '@lion/localize/test-helpers.js';
+import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
+import sinon from 'sinon';
+import { DefaultSuccess, MinLength, Required, ValidateMixin, Validator } from '../index.js';
import { AlwaysInvalid } from '../test-helpers.js';
-import { Validator, Required, MinLength, DefaultSuccess, ValidateMixin } from '../index.js';
-
export function runValidateMixinFeedbackPart() {
describe('Validity Feedback', () => {
let tagString;
@@ -241,9 +240,7 @@ export function runValidateMixinFeedbackPart() {
}
render() {
- return html`
- Custom for ${this.feedbackData[0].validator.constructor.name}
- `;
+ return html`Custom for ${this.feedbackData[0].validator.constructor.name}`;
}
},
);
diff --git a/packages/validate/test/lion-validation-feedback.test.js b/packages/validate/test/lion-validation-feedback.test.js
index 46374359c..0a5deab26 100644
--- a/packages/validate/test/lion-validation-feedback.test.js
+++ b/packages/validate/test/lion-validation-feedback.test.js
@@ -1,16 +1,12 @@
/* eslint-disable no-unused-vars, no-param-reassign */
+import { expect, fixture, html } from '@open-wc/testing';
import sinon from 'sinon';
-import { fixture, html, expect } from '@open-wc/testing';
import '../lion-validation-feedback.js';
import { AlwaysInvalid, AlwaysValid } from '../test-helpers.js';
describe('lion-validation-feedback', () => {
it('renders a validation message', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html``);
expect(el).shadowDom.to.equal('');
el.feedbackData = [{ message: 'hello', type: 'error', validator: new AlwaysInvalid() }];
await el.updateComplete;
@@ -18,11 +14,7 @@ describe('lion-validation-feedback', () => {
});
it('renders the validation type attribute', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html``);
el.feedbackData = [{ message: 'hello', type: 'error', validator: new AlwaysInvalid() }];
await el.updateComplete;
expect(el.getAttribute('type')).to.equal('error');
@@ -33,11 +25,7 @@ describe('lion-validation-feedback', () => {
});
it('success message clears after 3s', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html``);
const clock = sinon.useFakeTimers();
@@ -57,11 +45,7 @@ describe('lion-validation-feedback', () => {
});
it('does not clear error messages', async () => {
- const el = await fixture(
- html`
-
- `,
- );
+ const el = await fixture(html``);
const clock = sinon.useFakeTimers();