Skip to content

Add possibility to provide CollectStates in UseSimulatedEnvironment #397

@Abrissirba

Description

@Abrissirba

Is your feature request related to a problem? Please describe.
The time it takes to authenticate using UseSimulatedEnvironment is over 10 seconds. In one way it is a good way to illustrate how long it takes in real life and you get to see some different CollectStates in the UI. However, when you use the simulated environment in test environments or unit/integration tests it gets cumbersome to have to wait that long.

What area is it related to
Core

Describe the solution you'd like
One possible solution would be to add a parameter to UseSimulatedEnvironment to be able to set the List collectStates that is exposed in one of the constructors of BankIdSimulatedApiClient.

To make it easier some defaults could be exposed as a static, for example

  • Normal - tries to imitate a "normal" flow
  • All - Includes all the collect states to be able to verify that the ui can handle all different text lengths
  • Fast - As few states as possible to make the sign in as fast as possible.

Describe alternatives you've considered
Today it is possible to do this by implementing your own verison of UseSimulatedEnvironment by copying the private method from here, https://github.com/ActiveLogin/ActiveLogin.Authentication/blob/main/src/ActiveLogin.Authentication.BankId.Core/IBankIdBuilderExtensions.cs#L217-L234, and pass in your own instance of BankIdSimulatedApiClient

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions