diff options
author | Linus Groh <mail@linusgroh.de> | 2021-08-16 18:13:47 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-16 20:40:21 +0100 |
commit | 795e077eb87d61de8d779f2e53a1622a507780e3 (patch) | |
tree | 571329cde830f2ec5a6ef38ed5f7f1d39c855def /Userland/Libraries/LibJS/Tests/builtins/Temporal | |
parent | 31f65b8c500aa92a082653deb74fbfa11637a696 (diff) | |
download | serenity-795e077eb87d61de8d779f2e53a1622a507780e3.zip |
LibJS: Implement Temporal.PlainDate.prototype.toPlainMonthDay()
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins/Temporal')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDate/PlainDate.prototype.toPlainMonthDay.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDate/PlainDate.prototype.toPlainMonthDay.js b/Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDate/PlainDate.prototype.toPlainMonthDay.js new file mode 100644 index 0000000000..4dbbebb24a --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainDate/PlainDate.prototype.toPlainMonthDay.js @@ -0,0 +1,15 @@ +describe("correct behavior", () => { + test("length is 0", () => { + expect(Temporal.PlainDate.prototype.toPlainMonthDay).toHaveLength(0); + }); + + test("basic functionality", () => { + const plainDate = new Temporal.PlainDate(2021, 7, 6); + const plainMonthDay = plainDate.toPlainMonthDay(); + expect(plainMonthDay.calendar).toBe(plainDate.calendar); + expect(plainMonthDay.monthCode).toBe("M07"); + expect(plainMonthDay.day).toBe(6); + const fields = plainMonthDay.getISOFields(); + expect(fields.isoYear).toBe(1972); + }); +}); |