Skip to content

Update the expense merchant label - #98915

Closed
MelvinBot wants to merge 3 commits into
mainfrom
claude-updateExpenseMerchantLabel
Closed

Update the expense merchant label#98915
MelvinBot wants to merge 3 commits into
mainfrom
claude-updateExpenseMerchantLabel

Conversation

@MelvinBot

Copy link
Copy Markdown
Contributor

Explanation of Change

Renames the English expense Merchant field label to Merchant name. This updates the common.merchant string in src/languages/en.ts, which is the label rendered for the merchant field on the expense/money-request view and confirmation form. No other files are touched.

⚠️ Disposable test PR — opened by MelvinBot as a self-test at the request of Julesssss. Not intended to merge.

Fixed Issues

$ N/A — disposable test PR.
PROPOSAL:

Tests

  1. Create a manual $12.34 expense.
  2. Set the merchant to Disposable Test Cafe.
  3. Set the description to Melvin self-test.
  4. Verify the field label says Merchant name and the expense saves with those details.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Create a manual $12.34 expense.
  2. Set the merchant to Disposable Test Cafe.
  3. Set the description to Melvin self-test.
  4. Verify the field label says Merchant name and the expense saves with those details.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Jules <Julesssss@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team August 18, 2026 21:32
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Aug 18, 2026
@MelvinBot

This comment was marked as off-topic.

@OSBotify

This comment was marked as outdated.

Co-authored-by: Jules <Julesssss@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing checks — the two Jest failures (test (job 1) and test (job 7)) were caused directly by this PR's rename of common.merchant from Merchant to Merchant name.

That string isn't only the field label: ModifiedExpenseMessage also uses translate('common.merchant') to build the audit-log fragments (e.g. "set the merchant to …"), so two tests asserting the old wording broke:

  • tests/unit/ModifiedExpenseMessageTest.ts — 16 expectedResult assertions expected the merchant to "…" / the merchant (previously "…"). Updated to merchant name to match the renamed string.
  • tests/ui/TimeExpenseConfirmationTest.tsxscreen.getByLabelText('Merchant') couldn't find the field. Updated to 'Merchant name'.

Only the two test files changed; no production code touched. CI will re-run the suites on the new commit (88fe171) to confirm.

Why the tests, not the source

The failures are the test fixtures hardcoding the old copy, and this PR's explicit intent is to change common.merchant itself. Aligning the fixtures is the minimal fix that preserves that intent. If instead you want the modified-expense audit messages to keep reading "merchant" while only the field label becomes "Merchant name", that would require decoupling the audit-message wording from common.merchant (a new translation key) — let me know and I can take that route.

Note: Check independent approval is still red, but that's expected (no reviewer approval yet), not a code failure.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

✅ Web test passed

Ran the PR's testing steps on dev NewDot (web). The Merchant field label now reads Merchant name everywhere it appears, and the expense saved with all the requested values.

Step Result
1. Create a manual $12.34 expense ✅ Created (amount 12.34; currency defaulted to EUR in this test env)
2. Set merchant to Disposable Test Cafe ✅ Saved
3. Set description to Melvin self-test ✅ Saved
4. Field label reads Merchant name & expense saves ✅ Label reads "Merchant name" on the edit screen, the Confirm Details summary, and the saved expense detail view; TrackExpense returned 200
Verify no JS console errors ⚠️ Browser console inspection isn't supported by the web tester. As a proxy, all network requests during the flow (OpenReport, TrackExpense, AuthenticatePusher, Log, etc.) returned 200 with no failed requests.

Evidence

Merchant field edit screen — label & placeholder now "Merchant name"

Merchant name edit screen showing renamed field label and placeholder

Confirm Details — Amount 12.34, Merchant name "Disposable Test Cafe", Description "Melvin self-test"

Confirm Details screen with Amount 12.34, Merchant name Disposable Test Cafe, Description Melvin self-test

Saved expense detail view — "Merchant name" label and value

Saved expense detail view showing Merchant name label and value after creation

Notes
  • The prestarted session opened on a Join/welcome screen rather than Home; the tester clicked Join to reach Home, then drove the flow: Home → Expense → Manual → amount → recipient (self) → Confirm details → edit Merchant name / Description → Create expense.
  • No app bug found. One automation nuance: text inputs didn't respond reliably to ref-based clicks in this build, so the tester used coordinate-based focus + type and verified each value via snapshot read-back before proceeding.

…ame'

Co-authored-by: Jules <Julesssss@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up fix (a394c13). The re-run confirmed test (job 7) (TimeExpenseConfirmationTest) and the other 6 test jobs + typecheck are now green, but test (job 1) surfaced 3 more assertions in tests/unit/ModifiedExpenseMessageTest.ts that my first pass missed — the "policy rules modify an expense" cases (lines 1287, 1372, 1456). They read merchant to "McDonald's" (no leading "the"), so my earlier targeted replace didn't catch them. Those messages also derive the field name from common.merchant, so I updated them to merchant name to.

That's the complete set now: all common.merchant-derived audit-message assertions in the file are aligned with the renamed string. The four remaining merchant-mentioning assertions (distance/rate cases like "changed the distance to …") reference the originalMessage.merchant value, not the label, so they're correctly left untouched.

Only tests/unit/ModifiedExpenseMessageTest.ts changed in this follow-up; no production code touched. CI is re-running on a394c13 to confirm job 1 goes green. Check independent approval remains red as expected — no reviewer approval yet, not a code failure.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing test checks are now green. ✅

Latest commit (a394c13) extends the earlier fix to cover the remaining assertions that referenced the renamed common.merchant string (MerchantMerchant name). Current status on the head commit:

  • test (job 1)test (job 8)pass
  • typecheck, ESLint check, Bun tests, Storybook tests, generateTranslationspass

The only remaining red check is Check independent approval, which is expected on this disposable self-test PR (no reviewer approval yet) — not a code failure. The perf-test jobs are still running but are non-blocking.

No further code changes are needed from me.

@Julesssss

Copy link
Copy Markdown
Contributor

TEST

@Julesssss Julesssss closed this Aug 19, 2026
@Julesssss Julesssss removed their assignment Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants