Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ function render() {

const label = document.createElement("span");
label.className = "task-title";
label.textContent = task.title;
label.append(document.createTextNode(task.title));

const del = document.createElement("button");
del.type = "button";
del.className = "task-delete";
del.textContent = "✕";
del.setAttribute("aria-label", `Delete task: ${task.title}`);
del.setAttribute("aria-label", "Delete task");
del.addEventListener("click", async () => {
tasks = removeTask(tasks, task.id);
await save(tasks, user);
Expand Down
21 changes: 21 additions & 0 deletions test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ test("sanitizeTasks drops malformed rows and trims persisted fields", () => {
);
});

test("sanitizeTasks preserves complex emoji title sequences", () => {
assert.deepEqual(
sanitizeTasks([
{
id: "emoji",
title: "Plan trip 👨‍👩‍👧‍👦",
done: false,
createdAt: 20,
},
]),
[
{
id: "emoji",
title: "Plan trip 👨‍👩‍👧‍👦",
done: false,
createdAt: 20,
},
],
);
});

test("GitHub OAuth exchange sets an HTTP-only session cookie without exposing tokens", async () => {
const previousClientId = process.env.GITHUB_CLIENT_ID;
process.env.GITHUB_CLIENT_ID = "client-id";
Expand Down