diff --git a/package.json b/package.json index fd9e8f4..a6426f0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "json-server": "json-server --watch public/examples/json-server/db.json", "test": "vitest src/", - "coverage": "vitest run src/ --coverage", + "coverage": "vitest run src/ --coverage.enabled", "e2e": "bash bin/e2e.sh", "cypress": "npx cypress@14.0.0 open --config baseUrl=http://localhost:8081", "prettier:check": "npx prettier --check \"**/*.{ts,html,yaml,css,md,json}\"", diff --git a/src/examples/purity-todo/components/subtask-item.ts b/src/examples/purity-todo/components/subtask-item.ts index 9e9e26c..8240839 100644 --- a/src/examples/purity-todo/components/subtask-item.ts +++ b/src/examples/purity-todo/components/subtask-item.ts @@ -26,7 +26,9 @@ const handleSubtaskChange = patchTask({ id: task.id, subtasks: task.subtasks?.map((subtask, i) => - i === subtaskIndex ? {...subtask, description: value} : subtask + i === subtaskIndex + ? {...subtask, description: sanitize(value)} + : subtask ), }) } @@ -44,7 +46,7 @@ export const subtaskItem = ( ): string => { return render`
-
+
${description}
` : render` - render` height: min(90vw, 33vh); max-height: min(90vw, 33vh); transition: height .2s ease-in; - + background-size: cover; background-repeat: no-repeat; background-position: center; @@ -44,7 +44,7 @@ export const taskDetailsStyle = (): string => render` .task-details--description { flex-grow: 1; - background: #f0f0f0; + background: var(--background-color); } .description-edit, .subtask-input { @@ -52,6 +52,8 @@ export const taskDetailsStyle = (): string => render` padding: 4px 8px; border: none; height: 2rem; + background: var(--background-color); + color: var(--text-color); } .subtask { @@ -61,6 +63,14 @@ export const taskDetailsStyle = (): string => render` gap: 8px; } + .subtask-completed { + text-decoration: line-through; + width: 100%; + padding: 4px 8px; + color: var(--text-color); + opacity: 0.6; + } + .${SMALL_BUTTON} { width: 2rem; min-width: 2rem; diff --git a/src/examples/purity-todo/components/task-item.test.ts b/src/examples/purity-todo/components/task-item.test.ts index caa4397..b15cfb9 100644 --- a/src/examples/purity-todo/components/task-item.test.ts +++ b/src/examples/purity-todo/components/task-item.test.ts @@ -27,15 +27,22 @@ describe("task-item", () => { it("should render correctly for a given task item", () => { const item = getTestTask() expect(taskItem(item)).toMatchInlineSnapshot(` - "
  • test