woocommerce-ios
woocommerce-ios copied to clipboard
[Reader Manuals Consolidation] Explore using configuration for testability on CardReaderManualsViewModel init
From https://github.com/woocommerce/woocommerce-ios/pull/7266#discussion_r918012040
It might be worth passing in the configuration for testability here
When CardReaderManualsViewModel
initializes, it already does by populating the model with the supported readers via the configuration loader:
init() {
// Initialize the View Model only with the supported readers for a specific Store
self.configurationLoader = CardPresentConfigurationLoader()
let supportedReaders = configurationLoader.configuration.supportedReaders
self.manuals = supportedReaders.map { $0.manual }
}
It may be worth exploring it we should pass this configuration as an init parameter directly, in order to simplify tests.