Skip to content

Commit

Permalink
Add test for dates-dmy-sort overriding inferred dates-mdy-sort and up…
Browse files Browse the repository at this point in the history
…date release versions test.
  • Loading branch information
LeeWannacott committed May 15, 2023
1 parent 058e76b commit 58397c9
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions test/table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ test("Floating point numbers", () => {
test("Release Versions", () => {
expect(
createTestTable(
{ col0: ["4.0.1", "3.0.2", "4.1.0", "3.0.4", "4.2.0"] },
{ col0: ["4.18.0", "3.0.2", "4.1.0", "3.0.18", "4.2.0", "4.17.1"] },
{
classTags: "",
}
)
).toStrictEqual({ col0: ["3.0.2", "3.0.4", "4.0.1", "4.1.0", "4.2.0"] });
).toStrictEqual({
col0: ["3.0.2", "3.0.18", "4.1.0", "4.2.0", "4.17.1", "4.18.0"],
});
});

test("data-sort: example days of week", () => {
Expand Down Expand Up @@ -353,6 +355,33 @@ test("dates-mdy-sort: US style mm/dd/yyyy; delim . or / or -", () => {
});
});

test("dates-mdy-sort US style overrides inferred class dates-dmy-sort:", () => {
expect(
createTestTable(
{
col0: [
"1-14-1992",
"1.13.1992",
"4.30.2008",
"1/20/1992",
"10-12-2017",
"2/14/1992",
],
},
{ classTags: "dates-mdy-sort dates-dmy-sort" }
)
).toStrictEqual({
col0: [
"1.13.1992",
"1-14-1992",
"1/20/1992",
"2/14/1992",
"4.30.2008",
"10-12-2017",
],
});
});

test("dates-ymd-sort: ISO 8601 style yyyy/mm/dd; delim . or / or -", () => {
expect(
createTestTable(
Expand Down

0 comments on commit 58397c9

Please sign in to comment.