Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Jun 23, 2022
1 parent c328240 commit 76dd37d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/core/src/data-editor/data-editor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,38 @@ describe("data-editor", () => {
expect(spy).toBeCalledWith({ icon: "headerCode", title: "B", width: 160 }, 200, 1);
});

test.only("Auto Resize Column", async () => {
const spy = jest.fn();
jest.useFakeTimers();
render(<EventedDataEditor {...basicProps} onColumnResize={spy} />, {
wrapper: Context,
});
prep();
const canvas = screen.getByTestId("data-grid-canvas");

fireEvent.mouseDown(canvas, {
clientX: 310, // Col B Right Edge
clientY: 16, // Header
});

fireEvent.mouseUp(canvas, {
clientX: 310,
clientY: 16,
});

fireEvent.mouseDown(canvas, {
clientX: 310, // Col B Right Edge
clientY: 16, // Header
});

fireEvent.mouseUp(canvas, {
clientX: 310,
clientY: 16,
});

expect(spy).toBeCalledWith({ icon: "headerCode", title: "B", width: 160 }, 50, 1);
});

test("Resize Column End Called", async () => {
const spy = jest.fn();
jest.useFakeTimers();
Expand Down

0 comments on commit 76dd37d

Please sign in to comment.