Tasks 10-12 of the WP-A plan in one commit (the route modules import each other): - header extras portalled into the Phase 0 header: course switcher, search, Reading/Work, account - course frame with outline sidebar (mobile overlay, Escape closes), progress, gating locks - library: featured course, continue row, New and collection rows, course list, filters, search - LessonView: text (track switcher, folds, ordered hint tiers), video (resume, done near the end, timestamp notes, transcript), companion decks rendered with pdf.js (thumbs, arrows, fullscreen, per-slide notes), code files (tree, tabs, copy, zip, command), exercises (Web Worker runner or local command with optional pasted evidence), floating action bar - notes list, account (email/password, providers, SSO by email) and owner admin pages - pdf.js worker served from /api/learner/pdf.worker.mjs - browser entry @stc/feature-learner/web (the package index also carries the server half) Co-Authored-By: Claude Opus 5.5 <[email protected]>
20 lines
964 B
TypeScript
20 lines
964 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { renderToString } from "react-dom/server";
|
|
import { MemoryRouter } from "react-router-dom";
|
|
import { SignInForms } from "../src/web/account/AccountPage";
|
|
import AdminPage from "../src/web/account/AdminPage";
|
|
|
|
test("the sign-in page has email and password fields and a create-account switch", () => {
|
|
const out = renderToString(<MemoryRouter initialEntries={["/account?next=/c/sample"]}><SignInForms /></MemoryRouter>);
|
|
expect(out).toContain('type="email"');
|
|
expect(out).toContain('type="password"');
|
|
expect(out).toContain('autoComplete="current-password"');
|
|
expect(out).toContain("Create account");
|
|
});
|
|
|
|
test("the admin page renders its frame before the session is known", () => {
|
|
const out = renderToString(<MemoryRouter><AdminPage /></MemoryRouter>);
|
|
expect(out).toContain("Users, groups and library");
|
|
expect(out).not.toContain("Users and roles"); // owner-only sections wait for the session
|
|
});
|