You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After npm run rename to a new product name (e.g. NewApp), tests under apps/mobile/__tests__ and apps/web/**/__tests__ fail because they assert hardcoded template values (Beaker Stack, beakerstack, template GitHub URLs) while production code reads from @adopter/config/* (updated by rename in adopter/ only).
Related: #379 (rename scope), #380 (billing meter constant imports).
Steps to reproduce
Rename the template:
npm run rename -- --from "Beaker Stack" --to "NewApp" --preserve-upstream
Web — product id from adopter billing / app identity
Several web tests hardcode beakerstack as productId / p_product_id while hooks and pages use billingConfig.productId or appIdentity.productId (e.g. newapp after rename):
Expected href="https://github.com/Artificer-Innovations/BeakerStack"
Received href="https://github.com/Artificer-Innovations/NewApp"
(adopter/web/components/dashboard/DemoBanner.tsx and adopter/config/landing.ts are updated by rename; the test still expects the upstream template URL.)
Expected behavior
Template tests in apps/* should not hardcode template display names, product ids, or repo URLs when the code under test derives those values from adopter config.
Suggested patterns:
import{branding}from'@adopter/config/branding';expect(getByText(newRegExp(`${branding.displayName} web app`,'i'))).toBeTruthy();import{billingConfig}from'@adopter/config/billing';expect(adminProductId).toBe(billingConfig.productId);import{appIdentity}from'@adopter/config/app-identity';expect(rpc).toHaveBeenCalledWith('billing_demo_add_collection',{p_product_id: appIdentity.productId,});import{landingConfig}from'@adopter/config/landing';expect(link).toHaveAttribute('href',landingConfig.finalCta.secondaryCta.href);
Additional grep targets: apps/web/src/pages/__tests__/HomePage.test.tsx, BillingUsagePage.test.tsx, and other mocks with displayName: 'Beaker Stack' or product_id: 'beakerstack'.
Suggested fix
Update the affected tests to import values from @adopter/config/branding, billing, app-identity, or landing instead of hardcoding template literals.
Document in docs/renaming.md that adopters should grep apps/**/__tests__ for Beaker Stack, beakerstack, and template GitHub URLs after rename.
Summary
After
npm run renameto a new product name (e.g. NewApp), tests underapps/mobile/__tests__andapps/web/**/__tests__fail because they assert hardcoded template values (Beaker Stack,beakerstack, template GitHub URLs) while production code reads from@adopter/config/*(updated by rename inadopter/only).Related: #379 (rename scope), #380 (billing meter constant imports).
Steps to reproduce
Rename the template:
Run unit tests:
Actual behavior
Mobile — display name in billing UI copy
apps/mobile/__tests__/screens/billing/BillingScreens.test.tsxfails:Rendered UI correctly shows:
Because
BillingOverviewScreenuses:`… Update your payment method in the ${getAdopterConfig().branding.displayName} web app.`while the test asserts:
Web — product id from adopter billing / app identity
Several web tests hardcode
beakerstackasproductId/p_product_idwhile hooks and pages usebillingConfig.productIdorappIdentity.productId(e.g.newappafter rename):apps/web/src/admin/__tests__/adminUsageColumns.test.ts(
adminProductIdisbillingConfig.productId.)apps/web/src/billing/__tests__/useDemoCollections.test.tsx(multiple tests)(
useDemoCollectionsin@adopter/web/billingusesappIdentity.productId.)apps/web/src/pages/__tests__/SignupInvitePage.test.tsx(
finalizeInviteSignupsendsbillingConfig.productId.)Web — GitHub repo URL in dashboard demo banner
apps/web/src/pages/__tests__/DashboardPage.test.tsx(
adopter/web/components/dashboard/DemoBanner.tsxandadopter/config/landing.tsare updated by rename; the test still expects the upstream template URL.)Expected behavior
Template tests in
apps/*should not hardcode template display names, product ids, or repo URLs when the code under test derives those values from adopter config.Suggested patterns:
Affected files (confirmed in fork testing)
apps/mobile/__tests__/screens/billing/BillingScreens.test.tsxBeaker Stack web app@adopter/config/brandingapps/web/src/admin/__tests__/adminUsageColumns.test.ts'beakerstack'product idbillingConfig.productIdapps/web/src/billing/__tests__/useDemoCollections.test.tsxp_product_id: 'beakerstack'appIdentity.productIdapps/web/src/pages/__tests__/DashboardPage.test.tsxlandingConfigor adopter banner URLapps/web/src/pages/__tests__/SignupInvitePage.test.tsxproductId: 'beakerstack'billingConfig.productIdAdditional grep targets:
apps/web/src/pages/__tests__/HomePage.test.tsx,BillingUsagePage.test.tsx, and other mocks withdisplayName: 'Beaker Stack'orproduct_id: 'beakerstack'.Suggested fix
@adopter/config/branding,billing,app-identity, orlandinginstead of hardcoding template literals.docs/renaming.mdthat adopters should grepapps/**/__tests__forBeaker Stack,beakerstack, and template GitHub URLs after rename.npm run rename:checkto flag hardcoded product ids / display names inapps/(same class of drift as setup:full Supabase slug uses stale app.config.js; rename does not update apps/mobile branding #379).Workaround (adopters)
Replace hardcoded template strings in
apps/**/__tests__with imports from@adopter/config/*as shown above.