|
|
|
@ -471,7 +471,7 @@ describe("GenerationComposer", () => { |
|
|
|
}); |
|
|
|
|
|
|
|
await waitFor(() => { |
|
|
|
expect(screen.getByLabelText("移除参考图片")).toBeInTheDocument(); |
|
|
|
expect(screen.getByLabelText("移除参考图片 1")).toBeInTheDocument(); |
|
|
|
}); |
|
|
|
|
|
|
|
fireEvent.change(screen.getByPlaceholderText(/描述你想生成的内容/), { |
|
|
|
@ -489,6 +489,30 @@ describe("GenerationComposer", () => { |
|
|
|
expect((nodes[0].data as NanoBananaNodeData).inputImages[0]).toMatch(/^data:image\/png;base64,/); |
|
|
|
}); |
|
|
|
|
|
|
|
it("renders uploaded reference images in order instead of stacking them", async () => { |
|
|
|
render(<GenerationComposer />); |
|
|
|
|
|
|
|
const firstImage = new File(["first-reference"], "first.png", { type: "image/png" }); |
|
|
|
const secondImage = new File(["second-reference"], "second.png", { type: "image/png" }); |
|
|
|
fireEvent.change(screen.getByLabelText("上传参考图片"), { |
|
|
|
target: { files: [firstImage, secondImage] }, |
|
|
|
}); |
|
|
|
|
|
|
|
await waitFor(() => { |
|
|
|
expect(screen.getByTitle("参考图片 1")).toBeInTheDocument(); |
|
|
|
expect(screen.getByTitle("参考图片 2")).toBeInTheDocument(); |
|
|
|
}); |
|
|
|
|
|
|
|
const removeButtons = screen.getAllByLabelText(/移除参考图片/); |
|
|
|
expect(removeButtons).toHaveLength(2); |
|
|
|
|
|
|
|
fireEvent.click(screen.getByLabelText("移除参考图片 1")); |
|
|
|
await waitFor(() => { |
|
|
|
expect(screen.queryByTitle("参考图片 2")).not.toBeInTheDocument(); |
|
|
|
expect(screen.getByTitle("参考图片 1")).toBeInTheDocument(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
it("keeps upstream text authoritative without overwriting the local fallback prompt", async () => { |
|
|
|
useWorkflowStore.setState({ |
|
|
|
nodes: [ |
|
|
|
|