From 0a5b845b972eb1bf10d96fe8e463fccd4234412c Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 24 Jun 2024 10:18:45 -0400 Subject: [PATCH] remove old test --- .../relative-time/relative-time.test.ts | 15 --------------- src/components/relative-time/relative-time.ts | 10 ---------- 2 files changed, 25 deletions(-) diff --git a/src/components/relative-time/relative-time.test.ts b/src/components/relative-time/relative-time.test.ts index 60c5a6a3f..3451c3d96 100644 --- a/src/components/relative-time/relative-time.test.ts +++ b/src/components/relative-time/relative-time.test.ts @@ -26,20 +26,6 @@ const createRelativeTimeWithDate = async (relativeDate: Date): Promise { - const localize = new LocalizeController(relativeTime); - const titleTime = localize.date(yesterday, { - month: 'long', - year: 'numeric', - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - timeZoneName: 'short' - }); - const timeElement = extractTimeElement(relativeTime); - expect(timeElement?.title).to.equal(titleTime); -}; - const minuteInSeconds = 60_000; const hourInSeconds = minuteInSeconds * 60; const dayInSeconds = hourInSeconds * 24; @@ -144,7 +130,6 @@ describe('wa-relative-time', () => { await relativeTime.updateComplete; const timeElement = extractTimeElement(relativeTime); expect(timeElement?.dateTime).to.equal(yesterday.toISOString()); - expectTitleToMatchLocalizedTimeString(relativeTime); }); it('allows to use a short form of the unit', async () => { diff --git a/src/components/relative-time/relative-time.ts b/src/components/relative-time/relative-time.ts index c9aa3ef8c..c9607c860 100644 --- a/src/components/relative-time/relative-time.ts +++ b/src/components/relative-time/relative-time.ts @@ -31,7 +31,6 @@ export default class WaRelativeTime extends WebAwesomeElement { @state() private isoTime = ''; @state() private relativeTime = ''; - @state() private titleTime = ''; /** * The date from which to calculate time from. If not set, the current date and time will be used. When passing a @@ -72,15 +71,6 @@ export default class WaRelativeTime extends WebAwesomeElement { const { unit, value } = availableUnits.find(singleUnit => Math.abs(diff) < singleUnit.max)!; this.isoTime = then.toISOString(); - this.titleTime = this.localize.date(then, { - month: 'long', - year: 'numeric', - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - timeZoneName: 'short' - }); - this.relativeTime = this.localize.relativeTime(Math.round(diff / value), unit, { numeric: this.numeric, style: this.format