Skip to content

Improve testability by injecting analytics in OrderDetailsViewModel #11781

Open
@iamgabrielma

Description

@iamgabrielma

Currently there's 25+ calls to ServiceLocator in OrderDetailsViewModel that are mainly used for tracking events. We should inject the analytics provider directly rather than reaching for the shared instance.

This also causes that track events have to be tested with setups like:

let analytics = ServiceLocator.analytics.analyticsProvider as! MockAnalyticsProvider

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions