Skip to content

Commit da1fa91

Browse files
committed
Move tests in core to their own directory
1 parent 1176c80 commit da1fa91

18 files changed

+48
-49
lines changed

packages/core/src/data-grid/animation-manager.test.ts renamed to packages/core/test/animation-manager.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AnimationManager, HoverValues } from "./animation-manager";
1+
import { AnimationManager, HoverValues } from "../src/data-grid/animation-manager";
22

33
const OG_RAF = window.requestAnimationFrame;
44
const OG_CAF = window.cancelAnimationFrame;
@@ -13,7 +13,7 @@ describe("Animation manager", () => {
1313
const timestamp = performance.now();
1414
f(timestamp);
1515
}, 0);
16-
return (timeoutID as unknown) as number;
16+
return timeoutID as unknown as number;
1717
};
1818

1919
window.cancelAnimationFrame = (rafID: number) => {

packages/core/src/data-grid/cells/cells.test.tsx renamed to packages/core/test/cells.test.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { render } from "@testing-library/react";
2-
import { assert } from "../../common/support";
3-
import { GridCellKind, ImageCell, ImageEditorType, isObjectEditorCallbackResult, Rectangle } from "../data-grid-types";
4-
import { imageCellRenderer } from "./image-cell";
52
import * as React from "react";
63
import noop from "lodash/noop.js";
7-
import { getDefaultTheme } from "../..";
4+
import { type Rectangle, type ImageCell, GridCellKind, getDefaultTheme, isObjectEditorCallbackResult, type ImageEditorType } from "../src";
5+
import { assert } from "../src/common/support";
6+
import { imageCellRenderer } from "../src/data-grid/cells/image-cell";
87

98
function getMockEditorTarget(): Rectangle {
109
return {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render } from "@testing-library/react";
22
import * as React from "react";
3-
import ClickOutsideContainer from "./click-outside-container";
43
import userEvent from "@testing-library/user-event";
4+
import ClickOutsideContainer from "../src/click-outside-container/click-outside-container";
55

66
describe("click-outside-container", () => {
77
it("Triggers onClose when clicking outside", async () => {

packages/core/src/data-grid/color-parser.test.ts renamed to packages/core/test/color-parser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable sonarjs/no-duplicate-string */
2-
import { interpolateColors, parseToRgba, withAlpha, blend } from "./color-parser";
2+
import { blend, interpolateColors, parseToRgba, withAlpha } from "../src/data-grid/color-parser";
33

44
describe("interpolateColors", () => {
55
test("Smoke test", () => {

packages/core/src/common/common.test.ts renamed to packages/core/test/common.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { deepEqual, maybe } from "./support";
21
import { renderHook } from "@testing-library/react-hooks";
3-
import { useResizeDetector } from "./resize-detector";
2+
import { useResizeDetector } from "../src/common/resize-detector";
3+
import { maybe, deepEqual } from "../src/common/support";
44

55
describe("maybe", () => {
66
test("Returns when not crashing", () => {

packages/core/src/data-editor/data-editor-fns.test.ts renamed to packages/core/test/data-editor-fns.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { decodeHTML } from "./data-editor-fns";
1+
import { decodeHTML } from "../src/data-editor/data-editor-fns";
22

33
describe("data-editor-fns", () => {
44
test("decode html", () => {

packages/core/src/data-editor/data-editor-input.test.tsx renamed to packages/core/test/data-editor-input.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* eslint-disable sonarjs/no-duplicate-string */
22
import * as React from "react";
33
import { render, fireEvent, screen, act } from "@testing-library/react";
4-
import { DataEditor, DataEditorProps, GridCell, GridCellKind, GridSelection, Item } from "..";
5-
import type { DataEditorRef } from "./data-editor";
6-
import { CompactSelection } from "../data-grid/data-grid-types";
4+
import { DataEditor, DataEditorProps, GridCell, GridCellKind, GridSelection, Item } from "../src";
5+
import type { DataEditorRef } from "../src/data-editor/data-editor";
6+
import { CompactSelection } from "../src/data-grid/data-grid-types";
77

8-
jest.mock("../common/resize-detector", () => {
8+
jest.mock("../src/common/resize-detector", () => {
99
return {
1010
useResizeDetector: () => ({ ref: undefined, width: 1000, height: 1000 }),
1111
};

packages/core/src/data-editor/data-editor.test.tsx renamed to packages/core/test/data-editor.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import {
1010
GridSelection,
1111
isSizedGridColumn,
1212
Item,
13-
} from "..";
14-
import type { DataEditorRef } from "./data-editor";
15-
import type { SizedGridColumn } from "../data-grid/data-grid-types";
13+
} from "../src";
14+
import type { SizedGridColumn } from "../src/data-grid/data-grid-types";
15+
import type { DataEditorRef } from "../src/data-editor/data-editor";
1616

17-
jest.mock("../common/resize-detector", () => {
17+
jest.mock("../src/common/resize-detector", () => {
1818
return {
1919
useResizeDetector: () => ({ ref: undefined, width: 1000, height: 1000 }),
2020
};
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as React from "react";
22
import { render } from "@testing-library/react";
3-
import BubblesOverlayEditor from "./private/bubbles-overlay-editor";
4-
import DrilldownOverlayEditor from "./private/drilldown-overlay-editor";
5-
import { ImageOverlayEditor } from "..";
6-
import { MarkdownOverlayEditor } from "./private/markdown-overlay-editor";
7-
import NumberOverlayEditor from "./private/number-overlay-editor";
8-
import UriOverlayEditor from "./private/uri-overlay-editor";
3+
import BubblesOverlayEditor from "../src/data-grid-overlay-editor/private/bubbles-overlay-editor";
4+
import DrilldownOverlayEditor from "../src/data-grid-overlay-editor/private/drilldown-overlay-editor";
5+
import { ImageOverlayEditor } from "../src";
6+
import { MarkdownOverlayEditor } from "../src/data-grid-overlay-editor/private/markdown-overlay-editor";
7+
import NumberOverlayEditor from "../src/data-grid-overlay-editor/private/number-overlay-editor";
8+
import UriOverlayEditor from "../src/data-grid-overlay-editor/private/uri-overlay-editor";
99

1010
describe("data-grid-overlay", () => {
1111
test("Smoke test bubbles", async () => {

packages/core/src/data-grid/data-grid-types.test.ts renamed to packages/core/test/data-grid-types.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { GridCellKind, isTextEditableGridCell } from "./data-grid-types";
2-
import { CompactSelection, isEditableGridCell } from "..";
3-
import { sprites } from "./sprites";
1+
import { GridCellKind, isTextEditableGridCell } from "../src/data-grid/data-grid-types";
2+
import { CompactSelection, isEditableGridCell } from "../src";
3+
import { sprites } from "../src/data-grid/sprites";
44

55
describe("data-grid-types", () => {
66
test("Smoke test type checks", () => {

0 commit comments

Comments
 (0)