From 469c03f5e7976a3448f27d6fec3ea411d64cffa9 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Fri, 11 Mar 2022 09:14:17 -0500 Subject: [PATCH] prettier + tag fix --- .../button-group/button-group.test.ts | 69 ++++--- src/components/button/button.test.ts | 10 +- src/components/divider/divider.test.ts | 6 - .../format-bytes/format-bytes.test.ts | 28 +-- .../format-date/format-date.test.ts | 183 +++++++++++++----- .../format-number/format-number.test.ts | 106 ++++++---- 6 files changed, 255 insertions(+), 147 deletions(-) diff --git a/src/components/button-group/button-group.test.ts b/src/components/button-group/button-group.test.ts index 3f2e2567c..489cfcc2c 100644 --- a/src/components/button-group/button-group.test.ts +++ b/src/components/button-group/button-group.test.ts @@ -2,55 +2,61 @@ import { expect, fixture, html, elementUpdated } from '@open-wc/testing'; import type SlButtonGroup from './button-group'; describe('', () => { - describe('defaults ', () => { it('passes accessibility test', async () => { - const group = await fixture(html` - Button 1 Label - Button 2 Label - Button 3 Label - `); + const group = await fixture(html` + + Button 1 Label + Button 2 Label + Button 3 Label + + `); await expect(group).to.be.accessible(); }); it('default label empty', async () => { - const group = await fixture(html` - Button 1 Label - Button 2 Label - Button 3 Label - `); + const group = await fixture(html` + + Button 1 Label + Button 2 Label + Button 3 Label + + `); expect(group.label).to.equal(''); }); }); describe('slotted button classes', () => { - it('slotted buttons have the right classes applied based on their order', async () => { - const group = await fixture(html` - Button 1 Label - Button 2 Label - Button 3 Label - `); + const group = await fixture(html` + + Button 1 Label + Button 2 Label + Button 3 Label + + `); const allButtons = group.querySelectorAll('sl-button'); - const hasGroupClass = Array.from(allButtons).every((button) => button.classList.contains('sl-button-group__button')); + const hasGroupClass = Array.from(allButtons).every(button => + button.classList.contains('sl-button-group__button') + ); expect(hasGroupClass).to.be.true; expect(allButtons[0]).to.have.class('sl-button-group__button--first'); expect(allButtons[1]).to.have.class('sl-button-group__button--inner'); expect(allButtons[2]).to.have.class('sl-button-group__button--last'); - }); }); describe('focus and blur events', () => { it('toggles focus class to slotted buttons on focus/blur', async () => { - const group = await fixture(html` - Button 1 Label - Button 2 Label - Button 3 Label - `); - + const group = await fixture(html` + + Button 1 Label + Button 2 Label + Button 3 Label + + `); const allButtons = group.querySelectorAll('sl-button'); allButtons[0].dispatchEvent(new FocusEvent('focusin', { bubbles: true })); @@ -66,11 +72,13 @@ describe('', () => { describe('mouseover and mouseout events', () => { it('toggles hover class to slotted buttons on mouseover/mouseout', async () => { - const group = await fixture(html` - Button 1 Label - Button 2 Label - Button 3 Label - `); + const group = await fixture(html` + + Button 1 Label + Button 2 Label + Button 3 Label + + `); const allButtons = group.querySelectorAll('sl-button'); @@ -83,5 +91,4 @@ describe('', () => { expect(allButtons[0].classList.contains('sl-button-group__button--hover')).not.to.be.true; }); }); - }); diff --git a/src/components/button/button.test.ts b/src/components/button/button.test.ts index 43677116d..63e2862e5 100644 --- a/src/components/button/button.test.ts +++ b/src/components/button/button.test.ts @@ -3,9 +3,7 @@ import sinon from 'sinon'; import type SlButton from './button'; describe('', () => { - describe('when provided no parameters', () => { - it('passes accessibility test', async () => { const el = await fixture(html` Button Label `); await expect(el).to.be.accessible(); @@ -37,12 +35,11 @@ describe('', () => { it('should not have a caret present', async () => { const el = await fixture(html` Button Label `); - expect(el.shadowRoot?.querySelector('[part="caret"]')).not .to.exist; + expect(el.shadowRoot?.querySelector('[part="caret"]')).not.to.exist; }); }); describe('when disabled', () => { - it('passes accessibility test', async () => { const el = await fixture(html` Button Label `); await expect(el).to.be.accessible(); @@ -81,25 +78,20 @@ describe('', () => { }); describe('when loading', () => { - it('should have a spinner present', async () => { const el = await fixture(html` Button Label `); expect(el.shadowRoot!.querySelector('sl-spinner')).to.exist; }); - }); describe('when caret', () => { - it('should have a caret present', async () => { const el = await fixture(html` Button Label `); expect(el.shadowRoot!.querySelector('[part="caret"]')).to.exist; }); - }); describe('when href is present', () => { - it('should render as an ', async () => { const el = await fixture(html` Button Label `); expect(el.shadowRoot!.querySelector('a')).to.exist; diff --git a/src/components/divider/divider.test.ts b/src/components/divider/divider.test.ts index 174564463..eea6c70a9 100644 --- a/src/components/divider/divider.test.ts +++ b/src/components/divider/divider.test.ts @@ -2,7 +2,6 @@ import { elementUpdated, expect, fixture, html } from '@open-wc/testing'; import type SlDivider from './divider'; describe('', () => { - describe('defaults ', () => { it('passes accessibility test', async () => { const el = await fixture(html` `); @@ -19,7 +18,6 @@ describe('', () => { }); describe('vertical property change ', () => { - it('aria-orientation is updated', async () => { const el = await fixture(html` `); @@ -29,8 +27,4 @@ describe('', () => { expect(el.getAttribute('aria-orientation')).to.equal('vertical'); }); }); - - - - }); diff --git a/src/components/format-bytes/format-bytes.test.ts b/src/components/format-bytes/format-bytes.test.ts index 3409a77e6..4c266d459 100644 --- a/src/components/format-bytes/format-bytes.test.ts +++ b/src/components/format-bytes/format-bytes.test.ts @@ -2,9 +2,7 @@ import { expect, fixture, html, elementUpdated } from '@open-wc/testing'; import type SlFormatBytes from './format-bytes'; describe('', () => { - describe('defaults ', () => { - it('default properties', async () => { const el = await fixture(html` `); @@ -16,36 +14,34 @@ describe('', () => { }); describe('bytes', () => { - const results = [ { value: 12, short: '12 byte', long: '12 bytes', - narrow: '12B', + narrow: '12B' }, { value: 1200, short: '1.2 kB', long: '1.2 kilobytes', - narrow: '1.2kB', + narrow: '1.2kB' }, { value: 1200000, short: '1.2 MB', long: '1.2 megabytes', - narrow: '1.2MB', + narrow: '1.2MB' }, { value: 1200000000, short: '1.2 GB', long: '1.2 gigabytes', - narrow: '1.2GB', + narrow: '1.2GB' } ]; - - results.forEach((expected) => { + results.forEach(expected => { it('bytes : display formats', async () => { const el = await fixture(html` `); // short @@ -66,7 +62,6 @@ describe('', () => { expect(el.shadowRoot?.textContent).to.equal(expected.narrow); }); }); - }); describe('bits', () => { @@ -75,30 +70,29 @@ describe('', () => { value: 12, short: '12 bit', long: '12 bits', - narrow: '12bit', + narrow: '12bit' }, { value: 1200, short: '1.2 kb', long: '1.2 kilobits', - narrow: '1.2kb', + narrow: '1.2kb' }, { value: 1200000, short: '1.2 Mb', long: '1.2 megabits', - narrow: '1.2Mb', + narrow: '1.2Mb' }, { value: 1200000000, short: '1.2 Gb', long: '1.2 gigabits', - narrow: '1.2Gb', + narrow: '1.2Gb' } ]; - - results.forEach((expected) => { + results.forEach(expected => { it('bits : display formats', async () => { const el = await fixture(html` `); // short @@ -119,7 +113,5 @@ describe('', () => { expect(el.shadowRoot?.textContent).to.equal(expected.narrow); }); }); - }); - }); diff --git a/src/components/format-date/format-date.test.ts b/src/components/format-date/format-date.test.ts index 93ae1e1d3..0124aaf6e 100644 --- a/src/components/format-date/format-date.test.ts +++ b/src/components/format-date/format-date.test.ts @@ -3,7 +3,6 @@ import sinon from 'sinon'; import type SlFormatDate from './format-date'; describe('', () => { - describe('defaults ', () => { let clock; @@ -34,158 +33,242 @@ describe('', () => { expect(el.timeZoneName).to.be.undefined; expect(el.timeZone).to.be.undefined; expect(el.hourFormat).to.equal('auto'); - }); }); describe('lang property', () => { const results = [ - { lang: 'de', result: `1.1.${new Date().getFullYear()}`}, - { lang: 'de-CH', result: `1.1.${new Date().getFullYear()}`}, - { lang: 'fr', result: `01/01/${new Date().getFullYear()}`}, - { lang: 'es', result: `1/1/${new Date().getFullYear()}`}, - { lang: 'he', result: `1.1.${new Date().getFullYear()}`}, - { lang: 'ja', result: `${new Date().getFullYear()}/1/1`}, - { lang: 'nl', result: `1-1-${new Date().getFullYear()}`}, - { lang: 'pl', result: `1.01.${new Date().getFullYear()}`}, - { lang: 'pt', result: `01/01/${new Date().getFullYear()}`}, - { lang: 'ru', result: `01.01.${new Date().getFullYear()}`}, - ] - results.forEach((setup) => { + { lang: 'de', result: `1.1.${new Date().getFullYear()}` }, + { lang: 'de-CH', result: `1.1.${new Date().getFullYear()}` }, + { lang: 'fr', result: `01/01/${new Date().getFullYear()}` }, + { lang: 'es', result: `1/1/${new Date().getFullYear()}` }, + { lang: 'he', result: `1.1.${new Date().getFullYear()}` }, + { lang: 'ja', result: `${new Date().getFullYear()}/1/1` }, + { lang: 'nl', result: `1-1-${new Date().getFullYear()}` }, + { lang: 'pl', result: `1.01.${new Date().getFullYear()}` }, + { lang: 'pt', result: `01/01/${new Date().getFullYear()}` }, + { lang: 'ru', result: `01.01.${new Date().getFullYear()}` } + ]; + results.forEach(setup => { it(`date has correct language format: ${setup.lang}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); expect(el.shadowRoot?.textContent).to.equal(setup.result); }); }); }); describe('weekday property', () => { - const weekdays = [ 'narrow', 'short', 'long']; + const weekdays = ['narrow', 'short', 'long']; weekdays.forEach((weekdayFormat: 'narrow' | 'short' | 'long') => { it(`date has correct weekday format: ${weekdayFormat}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { weekday: weekdayFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { weekday: weekdayFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('era property', () => { - const eras = [ 'narrow', 'short', 'long']; + const eras = ['narrow', 'short', 'long']; eras.forEach((eraFormat: 'narrow' | 'short' | 'long') => { it(`date has correct era format: ${eraFormat}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { era: eraFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { era: eraFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('year property', () => { - const yearFormats = [ 'numeric', '2-digit']; + const yearFormats = ['numeric', '2-digit']; yearFormats.forEach((yearFormat: 'numeric' | '2-digit') => { it(`date has correct year format: ${yearFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { year: yearFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { year: yearFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('month property', () => { - const monthFormats = [ 'numeric', '2-digit', 'narrow', 'short', 'long']; + const monthFormats = ['numeric', '2-digit', 'narrow', 'short', 'long']; monthFormats.forEach((monthFormat: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long') => { it(`date has correct month format: ${monthFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { month: monthFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { month: monthFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('day property', () => { - const dayFormats = [ 'numeric', '2-digit']; + const dayFormats = ['numeric', '2-digit']; dayFormats.forEach((dayFormat: 'numeric' | '2-digit') => { it(`date has correct day format: ${dayFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { day: dayFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { day: dayFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('hour property', () => { - const hourFormats = [ 'numeric', '2-digit']; + const hourFormats = ['numeric', '2-digit']; hourFormats.forEach((hourFormat: 'numeric' | '2-digit') => { it(`date has correct hour format: ${hourFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { hour: hourFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { hour: hourFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('minute property', () => { - const minuteFormats = [ 'numeric', '2-digit']; + const minuteFormats = ['numeric', '2-digit']; minuteFormats.forEach((minuteFormat: 'numeric' | '2-digit') => { it(`date has correct minute format: ${minuteFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { minute: minuteFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { minute: minuteFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('second property', () => { - const secondFormats = [ 'numeric', '2-digit']; + const secondFormats = ['numeric', '2-digit']; secondFormats.forEach((secondFormat: 'numeric' | '2-digit') => { it(`date has correct second format: ${secondFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { second: secondFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { second: secondFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('timeZoneName property', () => { - const timeZoneNameFormats = [ 'short', 'long']; + const timeZoneNameFormats = ['short', 'long']; timeZoneNameFormats.forEach((timeZoneNameFormat: 'short' | 'long') => { it(`date has correct timeZoneName format: ${timeZoneNameFormats}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { timeZoneName: timeZoneNameFormat}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { timeZoneName: timeZoneNameFormat }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('timeZone property', () => { - const timeZones = [ 'America/New_York', 'America/Los_Angeles', 'Europe/Zurich']; - timeZones.forEach((timeZone) => { + const timeZones = ['America/New_York', 'America/Los_Angeles', 'Europe/Zurich']; + timeZones.forEach(timeZone => { it(`date has correct timeZoneName format: ${timeZone}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { timeZone: timeZone}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { timeZone: timeZone }).format( + new Date(new Date().getFullYear(), 0, 1) + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('hourFormat property', () => { - const hourFormatValues = [ 'auto', '12', '24']; - hourFormatValues.forEach((hourFormatValue) => { + const hourFormatValues = ['auto', '12', '24']; + hourFormatValues.forEach(hourFormatValue => { it(`date has correct hourFormat format: ${hourFormatValue}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` + + ` + ); - const expected = new Intl.DateTimeFormat('en-US', { hour12: hourFormatValue === 'auto' ? undefined : hourFormatValue === '12'}).format(new Date(new Date().getFullYear(), 0, 1)) + const expected = new Intl.DateTimeFormat('en-US', { + hour12: hourFormatValue === 'auto' ? undefined : hourFormatValue === '12' + }).format(new Date(new Date().getFullYear(), 0, 1)); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); diff --git a/src/components/format-number/format-number.test.ts b/src/components/format-number/format-number.test.ts index 23157b83c..04a366a8f 100644 --- a/src/components/format-number/format-number.test.ts +++ b/src/components/format-number/format-number.test.ts @@ -2,7 +2,6 @@ import { expect, fixture, html } from '@open-wc/testing'; import type SlFormatNumber from './format-number'; describe('', () => { - describe('defaults ', () => { it('default properties', async () => { const el = await fixture(html` `); @@ -18,14 +17,15 @@ describe('', () => { expect(el.maximumFractionDigits).to.be.undefined; expect(el.minimumSignificantDigits).to.be.undefined; expect(el.maximumSignificantDigits).to.be.undefined; - }); }); describe('lang property', () => { - [ 'de', 'de-CH', 'fr', 'es', 'he', 'ja', 'nl', 'pl', 'pt', 'ru' ].forEach((lang) => { + ['de', 'de-CH', 'fr', 'es', 'he', 'ja', 'nl', 'pl', 'pt', 'ru'].forEach(lang => { it(`number has correct language format: ${lang}`, async () => { - const el = await fixture(html` `); + const el = await fixture( + html` ` + ); const expected = new Intl.NumberFormat(lang, { style: 'decimal', useGrouping: true }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); @@ -33,98 +33,138 @@ describe('', () => { }); describe('type property', () => { - [ 'currency', 'decimal', 'percent' ].forEach((type) => { + ['currency', 'decimal', 'percent'].forEach(type => { it(`number has correct type format: ${type}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: type, currency: 'USD'}).format(1000); + const el = await fixture( + html` ` + ); + const expected = new Intl.NumberFormat('en-US', { style: type, currency: 'USD' }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('noGrouping property', () => { - it(`number has correct grouping format: no grouping`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { useGrouping: false} ).format(1000); + const el = await fixture(html` `); + const expected = new Intl.NumberFormat('en-US', { useGrouping: false }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); it(`number has correct grouping format: grouping`, async () => { - const el = await fixture(html` `); + const el = await fixture(html` `); const expected = new Intl.NumberFormat('en-US', { useGrouping: true }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); describe('currency property', () => { - [ 'USD', 'CAD', 'AUD', 'UAH' ].forEach((currency) => { + ['USD', 'CAD', 'AUD', 'UAH'].forEach(currency => { it(`number has correct type format: ${currency}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currency: currency}).format(1000); + const el = await fixture( + html` ` + ); + const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currency: currency }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('currencyDisplay property', () => { - [ 'symbol', 'narrowSymbol', 'code', 'name' ].forEach((currencyDisplay) => { + ['symbol', 'narrowSymbol', 'code', 'name'].forEach(currencyDisplay => { it(`number has correct type format: ${currencyDisplay}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: currencyDisplay}).format(1000); + const el = await fixture( + html` ` + ); + const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: currencyDisplay }).format( + 1000 + ); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('minimumIntegerDigits property', () => { - [ 4, 5, 6 ].forEach((minDigits) => { + [4, 5, 6].forEach(minDigits => { it(`number has correct type format: ${minDigits}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', minimumIntegerDigits: minDigits}).format(1000); + const el = await fixture( + html` ` + ); + const expected = new Intl.NumberFormat('en-US', { + style: 'decimal', + currencyDisplay: 'symbol', + minimumIntegerDigits: minDigits + }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('minimumFractionDigits property', () => { - [ 4, 5, 6 ].forEach((minFractionDigits) => { + [4, 5, 6].forEach(minFractionDigits => { it(`number has correct type format: ${minFractionDigits}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', minimumFractionDigits: minFractionDigits}).format(1000); + const el = await fixture( + html` ` + ); + const expected = new Intl.NumberFormat('en-US', { + style: 'decimal', + currencyDisplay: 'symbol', + minimumFractionDigits: minFractionDigits + }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('maximumFractionDigits property', () => { - [ 4, 5, 6 ].forEach((maxFractionDigits) => { + [4, 5, 6].forEach(maxFractionDigits => { it(`number has correct type format: ${maxFractionDigits}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', maximumFractionDigits: maxFractionDigits}).format(1000); + const el = await fixture( + html` ` + ); + const expected = new Intl.NumberFormat('en-US', { + style: 'decimal', + currencyDisplay: 'symbol', + maximumFractionDigits: maxFractionDigits + }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('minimumSignificantDigits property', () => { - [ 4, 5, 6 ].forEach((minSignificantDigits) => { + [4, 5, 6].forEach(minSignificantDigits => { it(`number has correct type format: ${minSignificantDigits}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', minimumSignificantDigits: minSignificantDigits}).format(1000); + const el = await fixture( + html` + + ` + ); + const expected = new Intl.NumberFormat('en-US', { + style: 'decimal', + currencyDisplay: 'symbol', + minimumSignificantDigits: minSignificantDigits + }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); describe('maximumSignificantDigits property', () => { - [ 4, 5, 6 ].forEach((maxSignificantDigits) => { + [4, 5, 6].forEach(maxSignificantDigits => { it(`number has correct type format: ${maxSignificantDigits}`, async () => { - const el = await fixture(html` `); - const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', maximumSignificantDigits: maxSignificantDigits}).format(1000); + const el = await fixture( + html` + + ` + ); + const expected = new Intl.NumberFormat('en-US', { + style: 'decimal', + currencyDisplay: 'symbol', + maximumSignificantDigits: maxSignificantDigits + }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); }); }); - });