feat: add assistant conversation widget
This commit is contained in:
1 parent
f3420a4149
commit
8e0a52fcd0
17 files changed
+779
-93
No files matched your search
@@ -129,6 +129,26 @@ describe("item actions create-item", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("should fit a wide widget to every board layout", () => {
|
||||
const layoutId = "compact-layout";
|
||||
const layout = new LayoutMockBuilder({ id: layoutId, columnCount: 4 }).build();
|
||||
const board = new BoardMockBuilder().addLayout(layout).addEmptySection({ id: "section" }).build();
|
||||
const layoutsSpy = vi.spyOn(boardContext, "getBoardLayouts");
|
||||
layoutsSpy.mockReturnValue([layoutId]);
|
||||
const emptyPositionSpy = vi.spyOn(emptyPositionModule, "getFirstEmptyPosition");
|
||||
emptyPositionSpy.mockReturnValue({ xOffset: 0, yOffset: 0 });
|
||||
|
||||
const result = createItemCallback({ kind: "assistant" })(board);
|
||||
|
||||
expect(result.items.at(0)?.layouts.at(0)).toEqual(
|
||||
expect.objectContaining({ width: layout.columnCount, height: 4 }),
|
||||
);
|
||||
expect(emptyPositionSpy).toHaveBeenCalledWith([], layout.columnCount, undefined, {
|
||||
width: layout.columnCount,
|
||||
height: 4,
|
||||
});
|
||||
});
|
||||
|
||||
test("clamps wide defaults and places below a full automatic canvas", () => {
|
||||
const board = new BoardMockBuilder().addEmptySection({ id: "canvas", yOffset: 0 }).build();
|
||||
const layout = board.layouts[0];
|
||||
|
||||
Reference in new issue
Block a user