Skip to content

Commit 6265efb

Browse files
committed
test: unify duration parsing test for all segments exceeding calendar constraints
1 parent 63ec765 commit 6265efb

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

packages/@internationalized/date/tests/string.test.js

+9-22
Original file line numberDiff line numberDiff line change
@@ -596,29 +596,16 @@ describe('string conversion', function () {
596596
});
597597
});
598598

599-
it('parses an ISO 8601 duration string that contains years, months, hours, and seconds including hours exceeding 23 and returns a DateTimeDuration object', function () {
600-
const duration = parseDuration('P18Y7MT30H15S');
599+
it('parses an ISO 8601 duration string with values exceeding normal calendar constraints', function () {
600+
const duration = parseDuration('P99Y99M99W99DT99H99M99S');
601601
expect(duration).toStrictEqual({
602-
years: 18,
603-
months: 7,
604-
weeks: 0,
605-
days: 0,
606-
hours: 30,
607-
minutes: 0,
608-
seconds: 15
609-
});
610-
});
611-
612-
it('parses an ISO 8601 duration string that contains years, months, hours, and seconds including hours exceeding 23 and returns a DateTimeDuration object', function () {
613-
const duration = parseDuration('PT36H');
614-
expect(duration).toStrictEqual({
615-
years: 0,
616-
months: 0,
617-
weeks: 0,
618-
days: 0,
619-
hours: 36,
620-
minutes: 0,
621-
seconds: 0
602+
years: 99,
603+
months: 99,
604+
weeks: 99,
605+
days: 99,
606+
hours: 99,
607+
minutes: 99,
608+
seconds: 99
622609
});
623610
});
624611

0 commit comments

Comments
 (0)