Skip to content

Commit

Permalink
add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sixlighthouses committed Jul 18, 2023
1 parent 2fccd67 commit 68c1b52
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/ReactViews/Workbench/Controls/DateTimeSelectorSectionSpec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
});
});

0 comments on commit 68c1b52

Please sign in to comment.