Skip to content

Commit

Permalink
test: 💍 base size tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prc5 committed Jul 1, 2024
1 parent 91102a6 commit 8a74383
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions __tests__/features/pan/pan.sizes.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { renderApp } from "../../utils";

describe("Pan [Sizes]", () => {
describe("When content is bigger than wrapper", () => {
it("should allow panning to the bottom-right end without moving back", async () => {
// TODO: Implement test
expect(true).toBe(true);
const { content, pan } = renderApp({
wrapperWidth: "100px",
wrapperHeight: "100px",
contentWidth: "200px",
contentHeight: "200px",
disablePadding: true,
});

pan({ x: 150, y: 150 });
expect(content.style.transform).toBe("translate(100px, 100px) scale(1)");
});
it("should allow panning with velocity", async () => {
// TODO: Implement test
Expand All @@ -14,6 +24,18 @@ describe("Pan [Sizes]", () => {
});
});
describe("When content is smaller than wrapper", () => {
it("should not allow for panning", async () => {
const { content, pan } = renderApp({
wrapperWidth: "100px",
wrapperHeight: "100px",
contentWidth: "50px",
contentHeight: "50px",
disablePadding: true,
});

pan({ x: 150, y: 150 });
expect(content.style.transform).toBe("translate(0px, 0px) scale(1)");
});
it("should not allow for panning with centering", async () => {
// TODO: Implement test
expect(true).toBe(true);
Expand All @@ -27,4 +49,26 @@ describe("Pan [Sizes]", () => {
expect(true).toBe(true);
});
});
describe("When content is equal to wrapper", () => {
it("should not allow for panning", async () => {
const { content, pan } = renderApp({
wrapperWidth: "100px",
wrapperHeight: "100px",
contentWidth: "100px",
contentHeight: "100px",
disablePadding: true,
});

pan({ x: 150, y: 150 });
expect(content.style.transform).toBe("translate(0px, 0px) scale(1)");
});
it("should allow to move content around the wrapper body", async () => {
// TODO: Implement test
expect(true).toBe(true);
});
it("should not allow to move beyond bounds", async () => {
// TODO: Implement test
expect(true).toBe(true);
});
});
});

0 comments on commit 8a74383

Please sign in to comment.