-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't crash the table on 1 million rows
- Loading branch information
Showing
18 changed files
with
383 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
frontend/src/components/data-table/__test__/columns.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Copyright 2024 Marimo. All rights reserved. */ | ||
import { expect, test } from "vitest"; | ||
import { uniformSample } from "../columns"; | ||
|
||
test("uniformSample", () => { | ||
const items = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]; | ||
|
||
expect(uniformSample(items, 2)).toMatchInlineSnapshot(` | ||
[ | ||
"A", | ||
"J", | ||
] | ||
`); | ||
expect(uniformSample(items, 4)).toMatchInlineSnapshot(` | ||
[ | ||
"A", | ||
"C", | ||
"F", | ||
"J", | ||
] | ||
`); | ||
expect(uniformSample(items, 100)).toBe(items); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.