UI: Fix missing label.allocated key in Status widget test mock#13546
Conversation
PR apache#13254 added an 'allocated' case to Status.vue getText() that calls $t('label.allocated'), but did not update the test mock data, causing two Allocated badge tests to fail in CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes failing Status widget unit tests by adding the missing label.allocated translation key to the Status test i18n mock so $t('label.allocated') resolves to “Allocated” instead of falling back to the raw key.
Changes:
- Add
"label.allocated": "Allocated"toui/tests/mockData/Status.mock.json. - Update JSON formatting to keep the mock valid (comma after the prior entry).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13546 +/- ##
============================================
- Coverage 20.14% 18.93% -1.22%
+ Complexity 18477 18476 -1
============================================
Files 5751 6221 +470
Lines 519415 560110 +40695
Branches 60625 68289 +7664
============================================
+ Hits 104648 106067 +1419
- Misses 403334 442417 +39083
- Partials 11433 11626 +193
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
It's already added in that file: cloudstack/ui/public/locales/en.json Line 398 in 167eb0a |
I see, the UI test only checks if there is label Allocated ... not other states |
|
github action passed merging |
Description
The allocated case in Status.vue's getText() method calls this.$t('label.allocated'), but the unit test mock (tests/mockData/Status.mock.json) was missing the corresponding key. This caused two Allocated
badge tests to fail in CI — i18n returned the raw key string, rendering as Label.allocated instead of Allocated.
Fix: Add "label.allocated": "Allocated" to the Status widget test mock, matching the value in en.json.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?