Skip to content

Commit 7959e79

Browse files
committed
test: expand unit, rules, and e2e coverage for inventory flows
1 parent c3f2532 commit 7959e79

File tree

6 files changed

+816
-32
lines changed

6 files changed

+816
-32
lines changed

test/e2e/artifacts/summary.json

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
11
{
2-
"startedAt": "2026-03-23T16:08:17.174Z",
3-
"finishedAt": "2026-03-23T16:08:21.690Z",
2+
"startedAt": "2026-03-25T14:24:01.381Z",
3+
"finishedAt": "2026-03-25T14:24:11.431Z",
44
"baseUrl": "http://127.0.0.1:3000",
55
"browserExecutablePath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
6-
"overallPass": true,
6+
"overallPass": false,
77
"results": [
88
{
99
"name": "owner-core-journey",
10-
"pass": true,
10+
"pass": false,
1111
"repro": [
1212
"Open /?e2e-role=owner.",
1313
"Click \"Sign in with Google\".",
1414
"Edit the first morning meal entry.",
1515
"Open Grocery List and mark Tomatoes as bought.",
1616
"Open Pantry & Logs, add Jeera, then mark it Running Low.",
1717
"Open Activity Logs and verify the new entry is shown."
18-
]
18+
],
19+
"error": {
20+
"name": "Error",
21+
"message": "Unable to click button \"Mark Bought\" for row containing \"Tomatoes\".",
22+
"stack": "Error: Unable to click button \"Mark Bought\" for row containing \"Tomatoes\".\n at clickTableRowButton (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:330:11)\n at async Object.runOwnerCoreFlow [as run] (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:483:3)\n at async runScenario (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:740:12)\n at async main (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:899:24)"
23+
},
24+
"screenshotPath": "/Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/artifacts/owner-core-journey.png"
1925
},
2026
{
2127
"name": "cook-ai-journey",
22-
"pass": true,
28+
"pass": false,
2329
"repro": [
2430
"Open /?e2e-role=cook.",
2531
"Click \"Sign in with Google\".",
26-
"Switch to English.",
32+
"Use default cook language profile.",
2733
"Use Smart Assistant with the standard pantry update prompt.",
28-
"Search Tomatoes, mark it Full, add a note for Atta, and verify the note is rendered."
29-
]
34+
"Search tomatoes, mark it Full, add a note for atta, and verify the note is rendered."
35+
],
36+
"error": {
37+
"name": "Error",
38+
"message": "Unable to set cook status Full for Tomatoes.",
39+
"stack": "Error: Unable to set cook status Full for Tomatoes.\n at setCookStatus (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:368:11)\n at async Object.runCookCoreFlow [as run] (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:525:3)\n at async runScenario (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:740:12)\n at async main (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:899:24)"
40+
},
41+
"screenshotPath": "/Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/artifacts/cook-ai-journey.png"
3042
},
3143
{
3244
"name": "ai-malformed-response",
3345
"pass": true,
3446
"repro": [
3547
"Open /?e2e-role=cook.",
3648
"Click \"Sign in with Google\".",
37-
"Switch to English.",
49+
"Use default cook language profile.",
3850
"Submit the malformed AI marker prompt.",
3951
"Verify the safe AI error message is rendered and the page stays usable."
4052
]
@@ -45,34 +57,73 @@
4557
"repro": [
4658
"Open /?e2e-role=cook.",
4759
"Click \"Sign in with Google\".",
48-
"Switch to English.",
60+
"Use default cook language profile.",
4961
"Submit the unmatched item marker prompt.",
5062
"Verify the successful update path runs and Milk moves onto the list."
5163
]
5264
},
5365
{
5466
"name": "note-save-path",
55-
"pass": true,
67+
"pass": false,
5668
"repro": [
5769
"Open /?e2e-role=cook.",
5870
"Click \"Sign in with Google\".",
59-
"Switch to English.",
71+
"Use default cook language profile.",
6072
"Search for Atta.",
6173
"Add a note and save it.",
6274
"Verify the note renders as saved quantity text."
63-
]
75+
],
76+
"error": {
77+
"name": "Error",
78+
"message": "Unable to open note editor for Atta.",
79+
"stack": "Error: Unable to open note editor for Atta.\n at setCookNote (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:402:11)\n at async Object.runNoteSavePathCheck [as run] (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:617:3)\n at async runScenario (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:740:12)\n at async main (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:899:24)"
80+
},
81+
"screenshotPath": "/Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/artifacts/note-save-path.png"
6482
},
6583
{
6684
"name": "remove-from-grocery-path",
67-
"pass": true,
85+
"pass": false,
6886
"repro": [
6987
"Open /?e2e-role=owner.",
7088
"Click \"Sign in with Google\".",
7189
"Open Grocery List.",
7290
"Mark Tomatoes as bought.",
7391
"Verify Tomatoes is removed from the grocery list."
92+
],
93+
"error": {
94+
"name": "Error",
95+
"message": "Unable to click button \"Mark Bought\" for row containing \"Tomatoes\".",
96+
"stack": "Error: Unable to click button \"Mark Bought\" for row containing \"Tomatoes\".\n at clickTableRowButton (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:330:11)\n at async Object.runRemoveFromGroceryPathCheck [as run] (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:642:3)\n at async runScenario (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:740:12)\n at async main (file:///Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/run.mjs:899:24)"
97+
},
98+
"screenshotPath": "/Users/vijaysehgal/Downloads/02-Portfolio/Rasoi-Planner-Project/test/e2e/artifacts/remove-from-grocery-path.png"
99+
},
100+
{
101+
"name": "owner-tab-keyboard-navigation",
102+
"pass": true,
103+
"repro": [
104+
"Open /?e2e-role=owner and sign in.",
105+
"Focus owner tabs and navigate with ArrowRight, End, and Home.",
106+
"Verify selected tab and panel mapping after each keypress."
107+
]
108+
},
109+
{
110+
"name": "owner-tab-keyboard-navigation-mobile",
111+
"pass": true,
112+
"repro": [
113+
"Open /?e2e-role=owner on mobile viewport and sign in.",
114+
"Navigate owner tabs with keyboard keys.",
115+
"Verify tab selection and active panel on mobile layout."
116+
]
117+
},
118+
{
119+
"name": "owner-pantry-mobile-card-workflow",
120+
"pass": true,
121+
"repro": [
122+
"Open /?e2e-role=owner on mobile viewport and sign in.",
123+
"Open Pantry tab and update Tomatoes through mobile card status select.",
124+
"Verify pantry update success feedback is shown."
74125
]
75126
}
76127
],
77-
"serverOutput": "\n> react-example@0.0.0 dev:e2e\n> vite --config test/e2e/vite.e2e.config.ts\n\n9:38:17 PM [vite] (client) Re-optimizing dependencies because vite config has changed\n\n VITE v6.4.1 ready in 425 ms\n\n ➜ Local: http://127.0.0.1:3000/\n"
128+
"serverOutput": "\n> react-example@0.0.0 dev:e2e\n> vite --config test/e2e/vite.e2e.config.ts\n\n\n VITE v6.4.1 ready in 267 ms\n\n ➜ Local: http://127.0.0.1:3000/\n"
78129
}

test/e2e/mocks/firebase-auth.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ export async function signInWithPopup(auth: Auth, _provider?: GoogleAuthProvider
5656
return { user: nextUser };
5757
}
5858

59+
export async function signInWithRedirect(auth: Auth, _provider?: GoogleAuthProvider): Promise<void> {
60+
const nextUser = createMockUser(resolveRequestedRole());
61+
saveSignedInUser(nextUser);
62+
auth.currentUser = nextUser;
63+
notifyAuthListeners();
64+
}
65+
5966
export async function signOut(auth: Auth): Promise<void> {
6067
saveSignedInUser(null);
6168
auth.currentUser = null;

0 commit comments

Comments
 (0)