summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-10-30 10:26:42 +0200
committerLinus Groh <mail@linusgroh.de>2021-10-30 16:32:20 +0200
commite9cbeeac457b9684c31f0b35e7fcd424bf1e8c30 (patch)
tree81e3d5537766bf6215f6a8a2ede7d7549725035a /Userland/Libraries/LibJS/Tests
parent5fde02184d20649a7da1ba0c8792927328037a0d (diff)
downloadserenity-e9cbeeac457b9684c31f0b35e7fcd424bf1e8c30.zip
LibJS: Implement Temporal.TimeZone.prototype.getNextTransition()
Diffstat (limited to 'Userland/Libraries/LibJS/Tests')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/Temporal/TimeZone/TimeZone.prototype.getNextTransition.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Temporal/TimeZone/TimeZone.prototype.getNextTransition.js b/Userland/Libraries/LibJS/Tests/builtins/Temporal/TimeZone/TimeZone.prototype.getNextTransition.js
new file mode 100644
index 0000000000..d92abb3111
--- /dev/null
+++ b/Userland/Libraries/LibJS/Tests/builtins/Temporal/TimeZone/TimeZone.prototype.getNextTransition.js
@@ -0,0 +1,25 @@
+describe("correct behavior", () => {
+ test("length is 1", () => {
+ expect(Temporal.TimeZone.prototype.getNextTransition).toHaveLength(1);
+ });
+
+ test("basic functionality", () => {
+ const timeZone = new Temporal.TimeZone("UTC");
+ const instant = new Temporal.Instant(0n);
+ expect(timeZone.getNextTransition(instant)).toBeNull();
+ });
+
+ test("custom offset", () => {
+ const timeZone = new Temporal.TimeZone("+01:30");
+ const instant = new Temporal.Instant(0n);
+ expect(timeZone.getNextTransition(instant)).toBeNull();
+ });
+});
+
+describe("errors", () => {
+ test("this value must be a Temporal.TimeZone object", () => {
+ expect(() => {
+ Temporal.TimeZone.prototype.getNextTransition.call("foo");
+ }).toThrowWithMessage(TypeError, "Not an object of type Temporal.TimeZone");
+ });
+});