Skip to content

Refactor Store.storeHistory tests to exercise the method directly#7

Merged
Samuel3 merged 6 commits into
feature/add-testsfrom
copilot/sub-pr-5-again
Mar 2, 2026
Merged

Refactor Store.storeHistory tests to exercise the method directly#7
Samuel3 merged 6 commits into
feature/add-testsfrom
copilot/sub-pr-5-again

Conversation

Copilot AI commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Refactors the Store.storeHistory unit tests to call storeHistory directly instead of manually manipulating history, and syncs app/package-lock.json with the feature/add-tests base branch to resolve the merge conflict.

Changes Made

  • Refactored Store.storeHistory tests: Tests now set up initial history state and call store.storeHistory(...) directly, asserting the resulting history.
  • Added test for uninitialized history: Added a test covering the history === undefined initialization branch in Store.prototype.storeHistory, using a global.getCurrentContent mock to exercise first-run behavior.
  • Synced app/package-lock.json: Updated to exactly match the feature/add-tests base branch (lockfileVersion 3, packages format) to eliminate the merge conflict and ensure npm ci is deterministic.

Testing

  • npm ci succeeds with synced lockfiles
  • ✅ All 48 tests pass (47 original + 1 new for the history === undefined branch)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on tests for LetterCreator feature Refactor Store.storeHistory tests to exercise the method directly Feb 28, 2026
@Samuel3 Samuel3 self-requested a review March 1, 2026 16:39
@Samuel3

Samuel3 commented Mar 1, 2026

Copy link
Copy Markdown
Owner

@copilot please fix build

Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>

Copilot AI commented Mar 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please fix build

Fixed in commit 7727f99. The CI was failing because a previous npm install had updated app/package-lock.json, causing npm ci to fail with "Missing: ... from lock file". Restored the lock file to its original state — all 47 tests pass and npm ci succeeds.

@Samuel3

Samuel3 commented Mar 2, 2026

Copy link
Copy Markdown
Owner

@copilot fix merge conflict with package-lock.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to refactor the Store.storeHistory unit tests to invoke storeHistory directly (instead of manually manipulating history), and it also touches dependency lockfiles related to an npm ci CI failure.

Changes:

  • Refactored Store.storeHistory tests to set up history state and call store.storeHistory(...) directly.
  • Updated app/package-lock.json contents (including changing lockfileVersion to 3 and converting to the npm v7+ “packages” format).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/store.test.js Simplifies Store.storeHistory tests by calling storeHistory directly and asserting resulting history state.
app/package-lock.json Large lockfile rewrite to npm lockfile v3 format (lockfileVersion: 3, packages section).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/package-lock.json
Comment thread test/store.test.js
…nflict

Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>

Copilot AI commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix merge conflict with package-lock.json

Fixed in commit 074aedb. Updated app/package-lock.json to match the current feature/add-tests branch (SHA 71fbb5099) — the root package-lock.json was already in sync. All 47 tests pass and npm ci succeeds.

…ined branch test

Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
@Samuel3

Samuel3 commented Mar 2, 2026

Copy link
Copy Markdown
Owner

@copilot please fix issue with conflict of app/package-lock.json

Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>

Copilot AI commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please fix issue with conflict of app/package-lock.json

Fixed in commit b786b7d. Updated app/package-lock.json to exactly match the current tip of feature/add-tests — the file now has zero diff against the base branch. All 48 tests pass and npm ci succeeds.

@Samuel3 Samuel3 marked this pull request as ready for review March 2, 2026 19:53
@Samuel3 Samuel3 merged commit 7c7080c into feature/add-tests Mar 2, 2026
2 checks passed
@Samuel3 Samuel3 deleted the copilot/sub-pr-5-again branch March 2, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants