import "module-alias/register" ; import { Address } from "@utils/types" ; import { Account } from "@utils/test/types" ; import { ResourceIdentifierMock } from "@utils/contracts" ; import DeployHelper from "@utils/deploys" ; import { addSnapshotBeforeRestoreAfterEach , getAccounts , getWaffleExpect , getSystemFixture , } from "@utils/test/index" ; import { SystemFixture } from "@utils/fixtures" ; const expect = getWaffleExpect ( ) ; describe ( "ResourceIdentifier" , ( ) => { let owner ; let deployer ; let resourceIdentifier ; let setup ; before ( async ( ) => { [ owner , ] = await getAccounts ( ) ; deployer = new DeployHelper ( owner . wallet ) ; setup = getSystemFixture ( owner . address ) ; await setup . initialize ( ) ; resourceIdentifier = await deployer . mocks . deployResourceIdentifierMock ( ) ; } ) ; addSnapshotBeforeRestoreAfterEach ( ) ; describe ( "#getIntegrationRegistry" , async ( ) => { let subjectController ; beforeEach ( async ( ) => { subjectController = setup . controller . address ; } ) ; async function subject ( ) { return resourceIdentifier . testGetIntegrationRegistry ( subjectController ) ; } it ( "should fetch the correct integration registry contract" , async ( ) => { const integrationRegistry = await subject ( ) ; expect ( integrationRegistry ) . to . eq ( setup . integrationRegistry . address ) ; } ) ; } ) ; describe ( "#getPriceOracle" , async ( ) => { let subjectController ; beforeEach ( async ( ) => { subjectController = setup . controller . address ; } ) ; async function subject ( ) { return resourceIdentifier . testGetPriceOracle ( subjectController ) ; } it ( "should fetch the correct price oracle contract" , async ( ) => { const priceOracle = await subject ( ) ; expect ( priceOracle ) . to . eq ( setup . priceOracle . address ) ; } ) ; } ) ; describe ( "#getSetValuer" , async ( ) => { let subjectController ; beforeEach ( async ( ) => { subjectController = setup . controller . address ; } ) ; async function subject ( ) { return resourceIdentifier . testGetSetValuer ( subjectController ) ; } it ( "should fetch the correct Set valuer contract" , async ( ) => { const setValuer = await subject ( ) ; expect ( setValuer ) . to . eq ( setup . setValuer . address ) ; } ) ; } ) ; } ) ;