philips-software/cogito

View on GitHub
workspaces/demo-app/src/__mocks__/@cogitojs/cogito-identity.js

Summary

Maintainability
A
0 mins
Test Coverage
export class CogitoIdentity {
  static Property = {
    Username: 'username',
    EthereumAddress: 'ethereumAddress'
  }
  constructor ({ channel }) {
    this.channel = channel
  }
  getInfo () {
    if (this.channel.error) {
      return Promise.reject(this.channel.error)
    } else {
      return Promise.resolve(this.channel.mockIdentityInfo())
    }
  }
}