Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/lib/__tests__/cardLayout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
normalizeCardLayout,
toggleBlockVisibility,
} from "../cardLayout";
import { DEFAULT_CARD_LAYOUT } from "../types";
import { CardBlockId, DEFAULT_CARD_LAYOUT } from "../types";
Comment thread
is0692vs marked this conversation as resolved.

describe("cardLayout utilities", () => {
describe("cloneDefaultCardLayout", () => {
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("toggleBlockVisibility", () => {
const layout = cloneDefaultCardLayout();
// Use unknown block ID
// We have to cast to unknown -> CardBlockId here because TS would complain
const next = toggleBlockVisibility(layout, "nonExistent" as unknown as import("../types").CardBlockId);
const next = toggleBlockVisibility(layout, "nonExistent" as unknown as CardBlockId);
Comment thread
is0692vs marked this conversation as resolved.

expect(next.blocks).toEqual(layout.blocks);
});
Expand All @@ -105,8 +105,7 @@ describe("toggleBlockVisibility", () => {

it("moveBlock returns original layout when moving non-existent block", () => {
const layout = cloneDefaultCardLayout();
// @ts-expect-error Testing invalid block ID
const moved = moveBlock(layout, "nonExistentBlock", "left", 0);
const moved = moveBlock(layout, "nonExistentBlock" as unknown as CardBlockId, "left", 0);
Comment thread
is0692vs marked this conversation as resolved.
Comment thread
is0692vs marked this conversation as resolved.

expect(moved).toBe(layout);
});
Expand Down
Loading