pull/2074/head
bunsenstraat 3 years ago
parent 0b2403d52d
commit 240da33497
  1. 22
      apps/remix-ide/src/app/tabs/test-tab.js

@ -7,6 +7,7 @@ import { TestTabLogic } from '@remix-ui/solidity-unit-testing' // eslint-disable
import { ViewPlugin } from '@remixproject/engine-web'
import helper from '../../lib/helper'
import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity'
import { ViewPluginUI } from '../components/ViewPluginUI'
var { UnitTestRunner, assertLibCode } = require('@remix-project/remix-tests')
@ -34,6 +35,7 @@ module.exports = class TestTab extends ViewPlugin {
this.offsetToLineColumnConverter = offsetToLineColumnConverter
this.allFilesInvolved = ['.deps/remix-tests/remix_tests.sol', '.deps/remix-tests/remix_accounts.sol']
this.element = document.createElement('div')
this.dispatch = null
}
onActivationInternal () {
@ -128,15 +130,25 @@ module.exports = class TestTab extends ViewPlugin {
})
}
setDispatch (dispatch) {
this.dispatch = dispatch
this.renderComponent('tests')
}
render () {
this.onActivationInternal()
this.renderComponent('tests')
return this.element
return <div><ViewPluginUI plugin={this} /></div>
}
updateComponent(state) {
return <SolidityUnitTesting testTab={state.testTab} helper={state.helper} initialPath={state.testDirPath} />
}
renderComponent (testDirPath) {
ReactDOM.render(
<SolidityUnitTesting testTab={this} helper={helper} initialPath={testDirPath} />
, this.element)
this.dispatch({
testTab: this,
helper: this.helper,
testDirPath: testDirPath
})
}
}

Loading…
Cancel
Save