Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

enhance activity management tests to include pause and resume functionality with breaks

Khuram Niazc064ac1327ab
diff --git a/.dockerignore b/.dockerignore
index f8338f4..5dbd41a 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,6 +1,6 @@
-node_modules
+**/node_modules
npm-debug.log
-.next
+**/.next
.vscode
.git
.env*
@@ -8,4 +8,11 @@ npm-debug.log
**/*.db
**/*.db-journal
data/
-jobsyncdb/
\ No newline at end of file
+jobsyncdb/
+
+# Not needed by the build; excluded so edits here don't bust layer cache
+evals
+docs
+coverage
+__tests__
+e2e
diff --git a/.env.example b/.env.example
index a8c0551..44efe46 100644
--- a/.env.example
+++ b/.env.example
@@ -8,6 +8,9 @@ TZ=America/Edmonton
# For homelab server, change the following to your server ip ex: http://192.168.x.x:3737
NEXTAUTH_URL=http://localhost:3737
+# Required when the app is not served from localhost (homelab ip, reverse proxy)
+AUTH_TRUST_HOST=true
+
# AUTH_SECRET is auto-generated by deploy.sh and docker-entrypoint.sh
# To set manually, uncomment and provide your own value:
# AUTH_SECRET=
@@ -25,6 +28,9 @@ DEEPSEEK_API_KEY=your-deepseek-api-key-here
# Google Gemini API Key - get from https://aistudio.google.com/apikey
GEMINI_API_KEY=your-gemini-api-key-here
+# OpenRouter API Key - get from https://openrouter.ai/keys
+OPENROUTER_API_KEY=your-openrouter-api-key-here
+
# For homelab server, if you ollama is running on server, change the following to your ollamma ip ex: http://192.168.x.x:12345
OLLAMA_BASE_URL=http://host.docker.internal:11434
@@ -33,3 +39,6 @@ OLLAMA_BASE_URL=http://host.docker.internal:11434
# No configuration needed - semantic extraction is the default
RAPIDAPI_KEY=your-rapidapi-key-here
+
+# Enables the MCP server in production (default: on in dev, off in prod)
+MCP_ENABLED=true
diff --git a/.gitignore b/.gitignore
index 2c106b8..6965117 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,14 +41,22 @@ release.sh
*.tsbuildinfo
next-env.d.ts
-# prisma sqlite database
-dev.db
-dev.db-journal
+# sqlite databases (prisma dev + docker volume), incl. WAL sidecars
+*.db
+*.db-journal
+*.db-wal
+*.db-shm
+*.sqlite
+*.sqlite3
+
+# local user data: uploaded resumes and the docker sqlite bind mount
+/data/
+/jobsyncdb/
+
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
-data/files/resumes
CLAUDE.md
/docs
.github/*
diff --git a/e2e/activities.spec.ts b/e2e/activities.spec.ts
index 6caaa1c..ce6c137 100644
--- a/e2e/activities.spec.ts
+++ b/e2e/activities.spec.ts
@@ -144,6 +144,72 @@ test.describe.serial("Activities Management", () => {
await expect(stoppedRow).toContainText(/min/);
});
+ test("should pause and resume an activity with a break", async ({
+ page,
+ cleanup,
+ }) => {
+ const activityName = uniqueName("E2E Break Activity");
+ const activityType = uniqueName("E2E Activity Type");
+ await createActivity(page, activityName, activityType, cleanup);
+
+ const row = page
+ .getByRole("row", { name: new RegExp(activityName, "i") })
+ .first();
+ await expect(row).toBeVisible({ timeout: 10000 });
+
+ await row.getByRole("button", { name: "Toggle menu" }).click();
+ await page
+ .getByRole("menuitem", { name: "Start Activity" })
+ .click({ force: true });
+
+ // Not getByRole({ name: "Stop" }) like the sibling tests: that is a
+ // substring match, and the modal's Stop Activity button has the same
+ // accessible name as the banner's. The aria-label attribute is the only
+ // thing that distinguishes them, and only the banner sets it.
+ const stopButton = page.locator('button[aria-label="Stop Activity"]');
+ await expect(stopButton).toBeVisible({ timeout: 10000 });
+
+ // The banner button only opens the modal; the break starts on play.
+ await page.getByRole("button", { name: "Take a break" }).click();
+ const breakDialog = page.getByRole("dialog");
+ await expect(breakDialog).toBeVisible({ timeout: 10000 });
+ await expect(breakDialog.getByText("Break", { exact: true })).toBeVisible();
+ await expect(breakDialog.getByText("15:00")).toBeVisible();
+
+ await breakDialog.getByRole("button", { name: "Start break" }).click();
+
+ // The centre control flipping to Resume proves the server opened the
+ // break: the context only re-renders from the action's returned activity.
+ const resumeButton = breakDialog.getByRole("button", {
+ name: "Resume activity",
+ });
+ await expect(resumeButton).toBeVisible({ timeout: 10000 });
+ // A running break drops the close X — Resume and Stop are the only exits.
+ await expect(breakDialog.getByRole("button", { name: "Close" })).toHaveCount(
+ 0,
+ );
+
+ // The modal locks the app: nothing behind it is clickable, so navigating
+ // away must fail rather than change the route.
+ // Located by href, not by name: the sidebar collapses to icons, so the
+ // "Jobs" label is not reliably part of the link's accessible name.
+ await expect(
+ page
+ .locator('a[href="/dashboard/myjobs"]')
+ .first()
+ .click({ timeout: 3000 }),
+ ).rejects.toThrow();
+ await expect(page).toHaveURL(/\/dashboard\/activities/);
+
+ await resumeButton.click();
+ await expect(breakDialog).not.toBeVisible({ timeout: 10000 });
+
+ // The activity survived the break and is still running.
+ await expect(stopButton).toBeVisible();
+ await stopButton.click({ force: true });
+ await expect(stopButton).not.toBeVisible({ timeout: 10000 });
+ });
+
test("should delete an activity", async ({ page, cleanup }) => {
const activityName = uniqueName("E2E Delete Activity");
const activityType = uniqueName("E2E Activity Type");