remove old test

This commit is contained in:
Cory LaViska
2024-06-24 10:18:45 -04:00
parent 6b58a7ac61
commit 0a5b845b97
2 changed files with 0 additions and 25 deletions

View File

@@ -26,20 +26,6 @@ const createRelativeTimeWithDate = async (relativeDate: Date): Promise<WaRelativ
return relativeTime;
};
const expectTitleToMatchLocalizedTimeString = (relativeTime: WaRelativeTime) => {
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 () => {

View File

@@ -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