Commit e145a2da authored by yann300's avatar yann300

fix e2e

parent 7accbc72
...@@ -94,7 +94,7 @@ module.exports = { ...@@ -94,7 +94,7 @@ module.exports = {
'Should fail on compilation, open file on error click, not disappear error': function (browser: NightwatchBrowser) { 'Should fail on compilation, open file on error click, not disappear error': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/compilationError_test.sol', sources[0]['compilationError_test.sol']) .addFile('tests/compilationError_test.sol', sources[0]['compilationError_test.sol'])
.click('div[title="default_workspace/tests/compilationError_test.sol"] span[class="close"]') .click('div[title="default_workspace/tests/compilationError_test.sol"] span[class="close-tabs"]')
.clickLaunchIcon('solidityUnitTesting') .clickLaunchIcon('solidityUnitTesting')
.pause(2000) .pause(2000)
.click('*[data-id="testTabCheckAllTests"]') .click('*[data-id="testTabCheckAllTests"]')
......
...@@ -31,7 +31,7 @@ export const TabsUI = (props: TabsUIProps) => { ...@@ -31,7 +31,7 @@ export const TabsUI = (props: TabsUIProps) => {
const renderTab = (tab, index) => { const renderTab = (tab, index) => {
const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass
const classNameTab = 'nav-item nav-link tab' + (index === selectedIndex ? ' active' : '') const classNameTab = 'nav-item nav-link tab' + (index === currentIndexRef.current ? ' active' : '')
return ( return (
<div ref={el => { tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> <div ref={el => { tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}>
{tab.icon ? (<img className="my-1 mr-1 iconImage" src={tab.icon} />) : (<i className={classNameImg}></i>)} {tab.icon ? (<img className="my-1 mr-1 iconImage" src={tab.icon} />) : (<i className={classNameImg}></i>)}
...@@ -44,12 +44,13 @@ export const TabsUI = (props: TabsUIProps) => { ...@@ -44,12 +44,13 @@ export const TabsUI = (props: TabsUIProps) => {
} }
const active = () => { const active = () => {
if (currentIndexRef.current < 0) return ''
return props.tabs[currentIndexRef.current].name return props.tabs[currentIndexRef.current].name
} }
const activateTab = (name: string) => { const activateTab = (name: string) => {
const index = props.tabs.findIndex((tab) => tab.name === name) const index = props.tabs.findIndex((tab) => tab.name === name)
setSelectedIndex(index)
currentIndexRef.current = index currentIndexRef.current = index
setSelectedIndex(index)
} }
useEffect(() => { useEffect(() => {
props.onReady({ props.onReady({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment