mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
20 lines
610 B
TypeScript
20 lines
610 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { masonryColumns } from "@/components/card-masonry";
|
|
|
|
describe("masonryColumns", () => {
|
|
it("stacks into one column when narrow", () => {
|
|
expect(masonryColumns(400, 4)).toBe(1);
|
|
});
|
|
|
|
it("grows with the container up to the preference", () => {
|
|
expect(masonryColumns(700, 3)).toBe(2);
|
|
expect(masonryColumns(1000, 3)).toBe(3);
|
|
expect(masonryColumns(1300, 3)).toBe(3);
|
|
expect(masonryColumns(1300, 4)).toBe(4);
|
|
});
|
|
|
|
it("falls back to three for an unknown preference", () => {
|
|
expect(masonryColumns(1300, 9)).toBe(3);
|
|
});
|
|
});
|