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
26 changes: 1 addition & 25 deletions desktop/src/apps/NotesApp.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen, act, waitFor, within, fireEvent } from "@testing-library/react";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { NotesApp, TodoApp } from "./NotesApp";
import { NotesApp } from "./NotesApp";

function mockFetch(
resolver: (url: string, init?: RequestInit) => { ok: boolean; status?: number; body: unknown },
Expand Down Expand Up @@ -178,27 +178,3 @@ describe("NotesApp", () => {
});
});

describe("TodoApp", () => {
beforeEach(() => {
vi.restoreAllMocks();
});

it("renders only lists, filtering out notes that share the same API", async () => {
vi.stubGlobal(
"fetch",
mockFetch(() => ({ ok: true, body: [noteDoc, listDoc] })),
);
render(<TodoApp windowId="w2" />);
await flush();

await waitFor(() => expect(screen.getByText("Sprint backlog")).toBeTruthy());
expect(screen.queryByText("Project kickoff")).toBeNull();
});

it("shows the todo empty state when there are no lists", async () => {
vi.stubGlobal("fetch", mockFetch(() => ({ ok: true, body: [] })));
render(<TodoApp windowId="w2" />);
await flush();
await waitFor(() => expect(screen.getByText(/no lists yet/i)).toBeTruthy());
});
});
18 changes: 0 additions & 18 deletions desktop/src/apps/NotesApp.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useEffect, useCallback, useRef } from "react";
import {
StickyNote,
ListChecks,
Plus,
Clock,
Users,
Expand Down Expand Up @@ -119,19 +118,6 @@ const NOTES_CONFIG: DocKindConfig = {
showDone: false,
};

const TODO_CONFIG: DocKindConfig = {
kind: "list",
appName: "Todo",
icon: ListChecks,
noun: "list",
titlePlaceholder: "List title...",
addPlaceholder: "Add a task...",
emptyDocs: "No lists yet.",
emptyEntries: "Nothing here yet. Add your first task above.",
selectPrompt: "Select a list to get started.",
showDone: true,
};

// ---- Sub-components ----

function MemberBadge({ member }: { member: NoteMember }) {
Expand Down Expand Up @@ -1171,7 +1157,3 @@ function DocsApp({ config }: { config: DocKindConfig }) {
export function NotesApp({ windowId: _windowId }: { windowId: string }) {
return <DocsApp config={NOTES_CONFIG} />;
}

export function TodoApp({ windowId: _windowId }: { windowId: string }) {
return <DocsApp config={TODO_CONFIG} />;
}
Loading
Loading