Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:

- run: pnpm install --frozen-lockfile

- name: Push database schema
run: pnpm db:push

- name: Install Playwright Chromium Browser
run: pnpm exec playwright install --with-deps chromium

Expand Down
16 changes: 12 additions & 4 deletions e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { test, expect } from "@playwright/test";

test("should load app, click analyze on default snippet, and render call graph nodes", async ({ page }) => {
test("should load app, click analyze on default snippet, and render call graph nodes", async ({
page,
}) => {
// 1. Visit the app in English locale
await page.goto("/en/app");

Expand All @@ -22,7 +24,13 @@ test("should load app, click analyze on default snippet, and render call graph n
await expect(nodes).toHaveCount(6);

// 6. Verify key node labels contain our function names and container file
await expect(page.locator(".react-flow__node", { hasText: "snippet.py" })).toBeVisible();
await expect(page.locator(".react-flow__node", { hasText: "main" })).toBeVisible();
await expect(page.locator(".react-flow__node", { hasText: "clean" })).toBeVisible();
await expect(
page.locator(".react-flow__node", { hasText: "snippet.py" }),
).toBeVisible();
await expect(
page.locator(".react-flow__node", { hasText: "main" }),
).toBeVisible();
await expect(
page.locator(".react-flow__node", { hasText: "clean" }),
).toBeVisible();
});
2 changes: 1 addition & 1 deletion src/components/layout/ThemeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function ThemeToggle() {
const next = !isDark;
document.documentElement.classList.toggle("dark", next);
localStorage.setItem("theme", next ? "dark" : "light");

// let it sync with cookies directly
document.cookie = `theme=${next ? "dark" : "light"}; path=/; max-age=31536000; SameSite=Lax`;
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/use-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export function useIsDark() {
() => document.documentElement.classList.contains("dark"),
() => false,
);
}
}