Skip to content

### Pull Request Title: refactor: single-source mock invoices from app/invest/lib.js#381

Open
SHEROSE0 wants to merge 1 commit into
Liquifact:mainfrom
SHEROSE0:refactor/invest-09-dedupe-mock-data
Open

### Pull Request Title: refactor: single-source mock invoices from app/invest/lib.js#381
SHEROSE0 wants to merge 1 commit into
Liquifact:mainfrom
SHEROSE0:refactor/invest-09-dedupe-mock-data

Conversation

@SHEROSE0

Copy link
Copy Markdown

#closes #186

Description

This PR resolves the issue of duplicated mock invoice data across the codebase. Previously, MOCK_INVOICES and loadMockInvoices were defined in both app/invest/lib.js and app/invest/page.js, leading to potential data drift and maintenance overhead.

This change establishes app/invest/lib.js as the canonical source of truth.

Changes

  • Cleanup: Removed inline MOCK_INVOICES, loadMockInvoices, and DEV_DELAY declarations from app/invest/page.js.
  • Centralization: Updated app/invest/page.js to import these assets directly from ./lib.
  • Documentation: Added a marker comment in app/invest/lib.js and updated docs/api-integration.md to clarify the data sourcing strategy for future contributors.
  • Testing: Extended app/invest/page.test.jsx to validate that the marketplace list correctly renders from the shared fixture.

Testing & Validation

  • Linting: npm run lint passed.
  • Build: npm run build completed successfully.
  • Grep Validation: Confirmed that MOCK_INVOICES is now only defined once in the repository.
  • Tests: Full test suite passed (see output below).

Acceptance Criteria Checklist

  • Inline mock data removed from page.js.
  • Single source of truth established in lib.js.
  • No behavior change for window.__TEST_MOCK_INVOICES__.
  • Docs updated in docs/api-integration.md.
  • Test coverage maintained at ≥ 95%.

#closes

Removes inline MOCK_INVOICES and loadMockInvoices from app/invest/page.js
to prevent data drift. Establishes app/invest/lib.js as the single source
of truth for mock data.
Hilary017 pushed a commit to Hilary017/Liquifact-frontend that referenced this pull request Jun 30, 2026
…-signature-delegate

feat: implement ephemeral signature delegate support
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.

Remove duplicated MOCK_INVOICES by sourcing all mock data from app/invest/lib.js

2 participants