[Unit Tests] Set default currency settings in AnalyticsHubViewModelTests test setup #8596
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.
Closes: #8561
Description
On
AnalyticsHubViewModelTests, testtest_cards_viewmodels_show_correct_data_after_updating_from_networkwe hardcode the dollar currency symbol when checking the leading value of the revenue card:XCTAssertEqual(vm.revenueCard.leadingValue, "$62")This was failing when the unit tests were run after running the app with a test store using different currency settings. (I could only reproduce it immediately after building and running the app normally, and then running the full test suite. The test always passed for me when running that specific test by itself.)
We could fix this by passing specific currency settings into the view model. However, a more straightforward solution for this test is to set the Service Locator to use the default currency settings during the test setup. This seems like a safe approach given that we are only enforcing the default settings for the tests.
Testing instructions
RELEASE-NOTES.txtif necessary.