mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:37:35 +00:00
LibJS: Implement Temporal.PlainTime.prototype.getISOFields()
This commit is contained in:
parent
c7bef42975
commit
e7c5c3d507
3 changed files with 68 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
describe("normal behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.PlainTime.prototype.getISOFields).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const plainTime = new Temporal.PlainTime(23, 53, 18, 123, 456, 789);
|
||||
const fields = plainTime.getISOFields();
|
||||
expect(fields).toEqual({
|
||||
calendar: plainTime.calendar,
|
||||
isoHour: 23,
|
||||
isoMicrosecond: 456,
|
||||
isoMillisecond: 123,
|
||||
isoMinute: 53,
|
||||
isoNanosecond: 789,
|
||||
isoSecond: 18,
|
||||
});
|
||||
// Test field order
|
||||
expect(Object.getOwnPropertyNames(fields)).toEqual([
|
||||
"calendar",
|
||||
"isoHour",
|
||||
"isoMicrosecond",
|
||||
"isoMillisecond",
|
||||
"isoMinute",
|
||||
"isoNanosecond",
|
||||
"isoSecond",
|
||||
]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue