mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
LibJS: Implement Temporal.PlainDate.prototype.getISOFields()
This commit is contained in:
parent
dc34cbe28b
commit
c7bef42975
3 changed files with 50 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
describe("normal behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.PlainDate.prototype.getISOFields).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const calendar = new Temporal.Calendar("iso8601");
|
||||
const plainDate = new Temporal.PlainDate(2021, 7, 29, calendar);
|
||||
const fields = plainDate.getISOFields();
|
||||
expect(fields).toEqual({ calendar, isoDay: 29, isoMonth: 7, isoYear: 2021 });
|
||||
// Test field order
|
||||
expect(Object.getOwnPropertyNames(fields)).toEqual([
|
||||
"calendar",
|
||||
"isoDay",
|
||||
"isoMonth",
|
||||
"isoYear",
|
||||
]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue