NXT-13028: Converted i18n/Text to functional component and fixed some root causes of unit tests console.error#3435
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3435 +/- ##
===========================================
+ Coverage 86.28% 86.45% +0.17%
===========================================
Files 156 156
Lines 7617 7765 +148
Branches 2017 2080 +63
===========================================
+ Hits 6572 6713 +141
- Misses 834 840 +6
- Partials 211 212 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ion-andrusciac-lgp
approved these changes
Jun 23, 2026
dan-ichim-lgp
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Issue Resolved / Feature Added
Resolution
Text.js:
i18n.js: Fixed the root cause of console.error in the unit tests "Cannot update a component (
I18nDecorator) while rendering a different component (I18nDecorator). To locate the bad setState() call insideI18nDecorator, follow the stack trace as described in "- Added this._updatingFromRender = false to the constructor.
- setContext now sets that flag (in a try/finally) around its loadResources call.
- _updateSnapshot only notifies when this._ready && !this._updatingFromRender.
use18n-specs.js :
a) Merge two unit test, because, the first one drives the I18n store directly: subscribe a listener, then call setContext('ar-SA') (the render-phase path useI18n triggers), and assert the listener is not notified while the snapshot is updated (getSnapshot().locale === 'ar-SA').
b) Added test for the scenario covered in i18n.js
Additional Considerations
Links
NXT-13028
Comments
Enact-DCO-1.0-Signed-off-by: Daniel Stoian (daniel.stoian@lgepartner.com)