From 68c1b52ef217625f43f12eb98cd057fb90753cb4 Mon Sep 17 00:00:00 2001 From: sixlighthouses Date: Tue, 18 Jul 2023 13:17:45 +1000 Subject: [PATCH] add some more tests --- .../Controls/DateTimeSelectorSectionSpec.tsx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/ReactViews/Workbench/Controls/DateTimeSelectorSectionSpec.tsx b/test/ReactViews/Workbench/Controls/DateTimeSelectorSectionSpec.tsx index 610fceec021..31696c6e66f 100644 --- a/test/ReactViews/Workbench/Controls/DateTimeSelectorSectionSpec.tsx +++ b/test/ReactViews/Workbench/Controls/DateTimeSelectorSectionSpec.tsx @@ -73,4 +73,40 @@ describe("DateTimeSelectorSection", function () { expect(buttons.length).toEqual(5); expect(currentDateBtn.children[0].children[0].children[0]).toEqual("2014"); }); + + it("A datetime selector can be formatted with a named option", async function () { + wmsItem.setTrait("definition", "dateFormat", "isoDateTime"); + expect(buttons).toBeDefined(); + expect(buttons.length).toEqual(5); + expect(currentDateBtn.children[0].children[0].children[0]).toEqual( + "2014-01-01T10:00:00+1000" + ); + }); + + it("A datetime selector can be formatted with a timeZone -03:00", async function () { + wmsItem.setTrait("definition", "timeZone", "-03:00"); + expect(buttons).toBeDefined(); + expect(buttons.length).toEqual(5); + expect(currentDateBtn.children[0].children[0].children[0]).toEqual( + "2014-01-01T07:00:00+1000" + ); + }); + + it("A datetime selector can be formatted with a timeZone +11", async function () { + wmsItem.setTrait("definition", "timeZone", "+11"); + expect(buttons).toBeDefined(); + expect(buttons.length).toEqual(5); + expect(currentDateBtn.children[0].children[0].children[0]).toEqual( + "2014-01-01T21:00:00+1000" + ); + }); + + it("A datetime selector can be formatted with a timeZone +11", async function () { + wmsItem.setTrait("definition", "timeZone", "+ee"); + expect(buttons).toBeDefined(); + expect(buttons.length).toEqual(5); + expect(currentDateBtn.children[0].children[0].children[0]).toEqual( + "2014-01-01" + ); + }); });