Skip to content

Commit 75685ee

Browse files
Add test for multiple clicks on same column.
1 parent 877d57f commit 75685ee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/table.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,23 @@ test("onload-sort: testing that it sorts without a click from user", () => {
230230
)
231231
).toStrictEqual({ col0: ["alpha", "bravo", "charlie", "delta", "echo"] });
232232
});
233+
234+
test("Clicking multiple times (>2) doesn't break sorting", () => {
235+
expect(
236+
createTestTable(
237+
{
238+
col0: ["charlie", "alpha", "beta"],
239+
col1: ["doris", "carrie", "fisher"],
240+
},
241+
{
242+
classTags: "",
243+
},
244+
{
245+
colsToClick: [0,0,0,0,0],
246+
}
247+
)
248+
).toStrictEqual({
249+
col0: ["alpha", "beta", "charlie"],
250+
col1: ["carrie", "fisher", "doris"],
251+
});
252+
});

0 commit comments

Comments
 (0)