Skip to content

Commit cc554ce

Browse files
Add test for micro format with past months
1 parent eedbd41 commit cc554ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/relative-time.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,17 @@ suite('relative-time', function () {
561561
await Promise.resolve()
562562
assert.equal(time.shadowRoot.textContent, '1d')
563563
})
564+
565+
test('micro formats months', async () => {
566+
const datetime = new Date()
567+
datetime.setMonth(datetime.getMonth() - 2)
568+
const time = document.createElement('relative-time')
569+
time.setAttribute('tense', 'past')
570+
time.setAttribute('datetime', datetime)
571+
time.setAttribute('format', 'micro')
572+
await Promise.resolve()
573+
assert.equal(time.shadowRoot.textContent, '2mo')
574+
})
564575
})
565576

566577
suite('[tense=future]', function () {

0 commit comments

Comments
 (0)