Sternboard: free retro board, no signup (initial)
CI/CD Pipeline / test (push) Successful in 26s
CI/CD Pipeline / build-and-push (push) Successful in 44s

Servidor Fastify + Socket.IO + Drizzle/Postgres; front Vite+React (EN/ES, tema claro/oscuro).
Tableros por columnas con plantillas, notas privadas/públicas, agrupación, votos
configurables (multivoto), timer compartido con alarma, fases, action items,
export Markdown/JSON e import, autodestrucción, gestión de columnas.
Imagen única (front servido por el servidor) y CI que la construye y publica.
This commit is contained in:
Millaguie
2026-06-16 10:27:33 +02:00
commit f11ea58c2c
64 changed files with 12359 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
import { describe, it, expect, beforeAll, afterAll } from "vitest";
import { startTestServer, createBoard, join, type TestServer } from "./helpers.js";
let server: TestServer;
beforeAll(async () => {
server = await startTestServer();
});
afterAll(async () => {
await server.close();
});
const myCount = (state: { votes: { targetId: string; participantId: string; count: number }[] }, targetId: string) =>
state.votes
.filter((v) => v.targetId === targetId && v.participantId === "alice")
.reduce((s, v) => s + v.count, 0);
describe("Multivoto", () => {
it("apila votos en el mismo ítem hasta el cupo y deja quitar", async () => {
const board = await createBoard(server.url, { votesPerUser: 3 }); // allowMultiVote por defecto: true
const alice = await join(server.url, board.boardId, "alice", "Alice");
const colId = alice.last!.columns[0].id;
alice.emit("note:add", { columnId: colId, text: "favorita" });
const noteId = (await alice.waitFor((s) => s.notes.length === 1)).notes[0].id;
alice.emit("vote:add", { targetType: "note", targetId: noteId });
alice.emit("vote:add", { targetType: "note", targetId: noteId });
alice.emit("vote:add", { targetType: "note", targetId: noteId });
const stacked = await alice.waitFor((s) => myCount(s, noteId) === 3);
expect(myCount(stacked, noteId)).toBe(3);
// 4º voto: cupo agotado, no sube
alice.emit("vote:add", { targetType: "note", targetId: noteId });
await new Promise((r) => setTimeout(r, 200));
expect(myCount(alice.last!, noteId)).toBe(3);
// quitar uno
alice.emit("vote:remove", { targetId: noteId });
const afterRemove = await alice.waitFor((s) => myCount(s, noteId) === 2);
expect(myCount(afterRemove, noteId)).toBe(2);
alice.close();
});
it("con allowMultiVote=false no se puede apilar en el mismo ítem", async () => {
const board = await createBoard(server.url, { votesPerUser: 5 });
const alice = await join(server.url, board.boardId, "alice", "Alice");
alice.emit("board:update", { allowMultiVote: false, moderatorToken: board.moderatorToken });
await alice.waitFor((s) => s.allowMultiVote === false);
const colId = alice.last!.columns[0].id;
alice.emit("note:add", { columnId: colId, text: "uno" });
const noteId = (await alice.waitFor((s) => s.notes.length === 1)).notes[0].id;
alice.emit("vote:add", { targetType: "note", targetId: noteId });
alice.emit("vote:add", { targetType: "note", targetId: noteId });
const after = await alice.waitFor((s) => myCount(s, noteId) >= 1);
await new Promise((r) => setTimeout(r, 200));
expect(myCount(after, noteId)).toBe(1);
alice.close();
});
});