Skip to content

(SP: 1) [SHOP] fix stale TEST_LEGAL_CONSENT import in test helper#443

Merged
liudmylasovetovs merged 1 commit intodevelopfrom
lso/feat/shop-fix
Apr 7, 2026
Merged

(SP: 1) [SHOP] fix stale TEST_LEGAL_CONSENT import in test helper#443
liudmylasovetovs merged 1 commit intodevelopfrom
lso/feat/shop-fix

Conversation

@liudmylasovetovs
Copy link
Copy Markdown
Collaborator

@liudmylasovetovs liudmylasovetovs commented Apr 7, 2026

Description

Fixes a build-breaking TypeScript error caused by a stale TEST_LEGAL_CONSENT import after migrating to the createTestLegalConsent() factory.

The helper makeCheckoutReq was still importing a removed constant, which caused Netlify build to fail during type checking. The fix updates the helper to use the runtime factory instead of a cached import-time value, aligning test helpers with the current legal-consent contract.


Related Issue

Issue: #<issue_number>


Changes

  • Replaced stale TEST_LEGAL_CONSENT import with createTestLegalConsent() in test helper
  • Updated helper to generate consent at call-time instead of relying on cached values
  • Ensured compatibility with updated legal-consent test contract

Database Changes (if applicable)

  • Schema migration required
  • Seed data updated
  • Breaking changes to existing queries
  • Transaction-safe migration
  • Migration tested locally on Neon

How Has This Been Tested?

  • Tested locally
  • Verified in development environment
  • Checked responsive layout (if UI-related)
  • Tested accessibility (keyboard / screen reader)

Screenshots (if applicable)

N/A


Checklist

Before submitting

  • Code has been self-reviewed
  • No TypeScript or console errors
  • Code follows project conventions
  • Scope is limited to this feature/fix
  • No unrelated refactors included
  • English used in code, commits, and docs
  • New dependencies discussed with team
  • Database migration tested locally (if applicable)
  • GitHub Projects card moved to In Review

Reviewers

Summary by CodeRabbit

  • Tests
    • Updated test helper for checkout requests to improve legal consent value generation during testing.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
devlovers-net Ignored Ignored Apr 7, 2026 1:31pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0961c200-cfc0-4d41-ab1d-17b738286e0c

📥 Commits

Reviewing files that changed from the base of the PR and between 3df1e46 and 0969bca.

📒 Files selected for processing (1)
  • frontend/lib/tests/helpers/makeCheckoutReq.ts

📝 Walkthrough

Walkthrough

The test helper makeCheckoutReq replaces a constant import with a function import, changing how it generates default legal consent values. Instead of using a shared TEST_LEGAL_CONSENT constant, it now calls createTestLegalConsent() when no legal consent is provided.

Changes

Cohort / File(s) Summary
Test Helper Update
frontend/lib/tests/helpers/makeCheckoutReq.ts
Changed from importing and using TEST_LEGAL_CONSENT constant to importing and calling createTestLegalConsent function for generating default legal consent in checkout request payloads.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • LesiaUKR
  • AM1007
  • ViktorSvertoka

Poem

🐰 A constant becomes a call,
Fresh consent created for all,
Two tiny lines dance with care,
Test helpers spring through the air,
Hopping to better defaults we share! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing a stale TEST_LEGAL_CONSENT import in a test helper by replacing it with createTestLegalConsent() factory calls.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lso/feat/shop-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@liudmylasovetovs liudmylasovetovs merged commit 902ccde into develop Apr 7, 2026
8 checks passed
@liudmylasovetovs liudmylasovetovs deleted the lso/feat/shop-fix branch April 7, 2026 13:34
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.

2 participants