Skip to content

Commit

Permalink
Add test for multiple clicks on same column.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeWannacott committed May 8, 2023
1 parent 877d57f commit 75685ee
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,23 @@ test("onload-sort: testing that it sorts without a click from user", () => {
)
).toStrictEqual({ col0: ["alpha", "bravo", "charlie", "delta", "echo"] });
});

test("Clicking multiple times (>2) doesn't break sorting", () => {
expect(
createTestTable(
{
col0: ["charlie", "alpha", "beta"],
col1: ["doris", "carrie", "fisher"],
},
{
classTags: "",
},
{
colsToClick: [0,0,0,0,0],
}
)
).toStrictEqual({
col0: ["alpha", "beta", "charlie"],
col1: ["carrie", "fisher", "doris"],
});
});

0 comments on commit 75685ee

Please sign in to comment.