Skip to content

Commit 43fe701

Browse files
arilivigniCopilot
andcommitted
Step 3: verify with unit tests + build only, never Playwright
The build prompt told the agent to 'run the app and confirm' UI behaviors (a row renders, survives reload), which the Copilot App satisfied by launching the Playwright MCP server and popping a browser — even though Step 3 is meant to be a headless build/test step and Playwright is introduced in Step 4. Rewrite the prompt's verification to explicitly use headless unit tests (URL normalisation, corrupted-storage recovery, exact ' :: ' formatting) plus 'npm run build', and add an explicit instruction not to open a browser or start the Playwright MCP server in this step. Align the 'watch the agent test' narration to match. Playwright now runs only in Step 4. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a9ddd07b-77bf-43e0-a5d9-c6426a067e0e
1 parent 8d3d52d commit 43fe701

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

.github/steps/3-step.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,21 @@ A few things to know about the build:
7171
> - Make sure a JavaScript error can never let the form fall back
7272
> to a native submit that reloads the page and loses the URL —
7373
> keep event.preventDefault() as the first thing on submit.
74-
> - Add a small unit test around the load/normalise helper so the
75-
> non-array case is covered.
74+
> - Add unit tests (no browser) around the pure helpers that cover:
75+
> - a URL with and without "https://" normalises to the same
76+
> saved value;
77+
> - loading an empty, corrupted, legacy, or non-array
78+
> "mona-bookmarks" value recovers instead of throwing;
79+
> - a saved bookmark formats as "<url> :: <slug>" with the exact
80+
> " :: " separator.
7681
>
77-
> Then run the app and confirm:
78-
> - Adding a URL with and without "https://" renders a bookmark
79-
> and it survives a reload.
80-
> - A pre-seeded, corrupted "mona-bookmarks" value doesn't break
81-
> Add — the app recovers instead of throwing.
82-
> - Adding a bookmark renders a new row immediately, without a
83-
> full page reload.
84-
> - The rendered row includes the exact " :: " separator between
85-
> the URL text and the slug.
82+
> Verify your work without launching a browser:
83+
> - Run the unit tests and make sure they pass.
84+
> - Run the production build (npm run build) and make sure it
85+
> succeeds — this proves localStorage stays behind the
86+
> client:load boundary.
87+
> Do not open a browser or start the Playwright MCP server in this
88+
> step; previewing and driving the running app comes in Step 4.
8689
>
8790
> Then open a pull request — but don't merge it:
8891
> - Include "Closes https://github.com/{{full_repo_name}}/issues/2"
@@ -93,7 +96,7 @@ A few things to know about the build:
9396
> ```
9497
9598
<img width="360" alt="The build prompt in the session with the Build the bookmarks app issue #2 referenced as a chip" src="../images/step3-issue-prompt.png" />
96-
1. **Watch the agent test the implementation.** Building the feature includes verifying it — Copilot runs the **unit tests** you asked for and builds the app, confirming a URL with and without `https://` is stored, that bookmarks survive a reload, and that a corrupted `mona-bookmarks` value doesn't break **Add**. You'll preview the app live and drive it with Playwright in **Step 4** — here the tests and build are enough to trust the diff before you merge.
99+
1. **Watch the agent test the implementation.** Building the feature includes verifying it — Copilot runs the **unit tests** you asked for and the **production build**, all headless: no browser opens and the Playwright MCP server stays idle. The tests cover URL normalisation, corrupted-storage recovery, and the exact `" :: "` formatting, while the build proves `localStorage` stays behind the `client:load` boundary. You'll preview the app live and drive it with Playwright in **Step 4** — here the tests and build are enough to trust the diff before you merge.
97100
1. **Review the diff before you merge.** Agent merge opens the pull request that links issue **#2** for you — review the changes in the session's **Changes** tab (or a browser canvas on the PR). You'll merge it in **Activity 2** once you're satisfied.
98101
99102
<img width="440" alt="Session review of the base62 nextSlug helper (mona- prefixed slugs), persistence and event-wiring notes, with Changes +107 -21 and PR #4 buttons at the bottom" src="../images/ghcp-app-step3.png" />

0 commit comments

Comments
 (0)