sygmaprotocol / sygma-widget

Transfer widget for the sygmaprotocol
5 stars 2 forks source link

Add tests for `FungibleTokenTransferController` #177

Open saadjhk opened 2 months ago

saadjhk commented 2 months ago

Testing the FungibleTokenTransferController

FungibleTokenTransferController houses most of the logic required to initiate fungible transfers using buildwithsygma/sygma-sdk-core. However, since there are no tests written so far I would like to write down the approach and setup required to test its functionality.

Mocking

In order to test functionality of the controller itself, we will have to mock its dependancies. Controller logic is coupled with the following components:

For testing EVM and Substrate Build and execute methods

Approach to testing

Goal is to test the logic within FungibleTokenTransferController assuming that most of its dependancies would be using mocked values. Have a configuration of two EVM chains and one substrate chain each having a resource that can be transferred bi-directionally.

Test cases