diff --git a/src/components/format-date/format-date.test.ts b/src/components/format-date/format-date.test.ts index b0dfc3306..a7e95a7bf 100644 --- a/src/components/format-date/format-date.test.ts +++ b/src/components/format-date/format-date.test.ts @@ -56,7 +56,7 @@ describe('', () => { ` ); - expect(el.shadowRoot?.textContent).to.equal(setup.result); + expect(el.shadowRoot?.textContent?.trim()).to.equal(setup.result); }); }); }); @@ -77,7 +77,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { weekday: weekdayFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -95,7 +95,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { era: eraFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -113,7 +113,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { year: yearFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -131,7 +131,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { month: monthFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -149,7 +149,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { day: dayFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -167,7 +167,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { hour: hourFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -188,7 +188,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { minute: minuteFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -209,7 +209,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { second: secondFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -230,7 +230,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { timeZoneName: timeZoneNameFormat }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -251,7 +251,7 @@ describe('', () => { const expected = new Intl.DateTimeFormat('en-US', { timeZone: timeZone }).format( new Date(new Date().getFullYear(), 0, 1) ); - expect(el.shadowRoot?.textContent).to.equal(expected); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); }); @@ -272,7 +272,7 @@ describe('', () => { 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); + expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); }); });