feat(tickets): multi-sélection dans TicketPicker (#41)
Le TicketPicker permet la sélection multiple de tickets ; SprintManager consomme la sélection multiple. Frontend-pur. QA vert : tsc --noEmit exit 0, vitest 62 fichiers / 620 tests passés. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -896,23 +896,26 @@ describe("SprintManager (#11)", () => {
|
||||
expect(fresh.title).toBe("Kept");
|
||||
});
|
||||
|
||||
it("adds a backlog ticket to a sprint via the TicketPicker popup (#19)", async () => {
|
||||
it("adds several backlog tickets to a sprint in one pass via the multi picker (#19/#41)", async () => {
|
||||
ticket._seedSprint(PROJECT_ID, { id: "s1", order: 1, name: "Target" });
|
||||
const t = await ticket.create(PROJECT_ID, { title: "Backlog item" });
|
||||
const t1 = await ticket.create(PROJECT_ID, { title: "Backlog item" });
|
||||
const t2 = await ticket.create(PROJECT_ID, { title: "Backlog item 2" });
|
||||
|
||||
const dialog = await openManager();
|
||||
|
||||
// Open the add-ticket picker for the Target sprint.
|
||||
// Open the add-ticket picker for the Target sprint (multi-select).
|
||||
fireEvent.click(
|
||||
await within(dialog).findByLabelText("add ticket to sprint Target"),
|
||||
);
|
||||
|
||||
// The picker popup lists the backlog ticket — select it.
|
||||
fireEvent.click(await screen.findByLabelText(`select ticket ${t.ref}`));
|
||||
// The picker toggles rows without assigning; confirm applies the batch.
|
||||
fireEvent.click(await screen.findByLabelText(`select ticket ${t1.ref}`));
|
||||
fireEvent.click(await screen.findByLabelText(`select ticket ${t2.ref}`));
|
||||
fireEvent.click(screen.getByLabelText("confirm ticket selection"));
|
||||
|
||||
await waitFor(async () => {
|
||||
const fresh = await ticket.read(PROJECT_ID, t.ref);
|
||||
expect(fresh.sprintId).toBe("s1");
|
||||
expect((await ticket.read(PROJECT_ID, t1.ref)).sprintId).toBe("s1");
|
||||
expect((await ticket.read(PROJECT_ID, t2.ref)).sprintId).toBe("s1");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user