component load

pull/1862/head
Aniket-Engg 3 years ago committed by Aniket
parent a89a527d11
commit 72e4bdcea2
  1. 13
      apps/remix-ide/src/app/tabs/test-tab.js

@ -50,6 +50,7 @@ module.exports = class TestTab extends ViewPlugin {
this.allFilesInvolved = ['.deps/remix-tests/remix_tests.sol', '.deps/remix-tests/remix_accounts.sol']
this.isDebugging = false
this.currentErrors = []
this.element = document.createElement('div')
appManager.event.on('activate', (name) => {
if (name === 'solidity') this.updateRunAction()
@ -60,6 +61,7 @@ module.exports = class TestTab extends ViewPlugin {
}
onActivationInternal () {
console.log('onActivationInternal---start->')
this.testTabLogic = new TestTabLogic(this.fileManager)
this.listenToEvents()
this.call('filePanel', 'registerContextMenuItem', {
@ -71,6 +73,7 @@ module.exports = class TestTab extends ViewPlugin {
path: [],
pattern: []
})
console.log('onActivationInternal---end->')
}
async setTestFolderPath (event) {
@ -92,6 +95,7 @@ module.exports = class TestTab extends ViewPlugin {
}
async onActivation () {
console.log('onActivation--->')
const isSolidityActive = await this.call('manager', 'isActive', 'solidity')
if (!isSolidityActive) {
await this.call('manager', 'activatePlugin', 'solidity')
@ -99,10 +103,10 @@ module.exports = class TestTab extends ViewPlugin {
await this.testRunner.init()
await this.createTestLibs()
this.updateRunAction()
this.renderComponent()
}
onDeactivation () {
console.log('onDeactivation--->')
this.off('filePanel', 'newTestFileCreated')
this.off('filePanel', 'setWorkspace')
// 'currentFileChanged' event is added more than once
@ -110,6 +114,7 @@ module.exports = class TestTab extends ViewPlugin {
}
listenToEvents () {
console.log('listenToEvents--start-->')
this.on('filePanel', 'newTestFileCreated', async file => {
try {
await this.testTabLogic.getTests((error, tests) => {
@ -147,6 +152,7 @@ module.exports = class TestTab extends ViewPlugin {
})
this.fileManager.events.on('currentFileChanged', (file, provider) => this.updateForNewCurrent(file))
console.log('listenToEvents--end-->')
}
async updateForNewCurrent (file) {
@ -796,13 +802,18 @@ module.exports = class TestTab extends ViewPlugin {
}
render () {
console.log('render--->')
this.onActivationInternal()
this.renderComponent()
return this.element
}
renderComponent () {
console.log('renderComponent-start-->')
ReactDOM.render(
<SolidityUnitTesting api={this}/>
, this.element)
console.log('renderComponent-end-->')
}
render2 () {

Loading…
Cancel
Save