ActiveLogin.Authentication icon indicating copy to clipboard operation
ActiveLogin.Authentication copied to clipboard

Add possibility to provide CollectStates in UseSimulatedEnvironment

Open Abrissirba opened this issue 1 year ago • 0 comments

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<CollectState> 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

Abrissirba avatar Dec 14 '22 15:12 Abrissirba