mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
remove old test
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user