Skip to content

Commit a176c52

Browse files
committed
fix existing e2e
1 parent 79130a5 commit a176c52

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

apps/remix-ide-e2e/src/tests/toggle_panels.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,22 @@ module.exports = {
2626
.waitForElementVisible('*[data-pinnedPlugin="movePluginToLeft-solidity"]')
2727
.clickLaunchIcon('filePanel')
2828
},
29-
'Toggle right side panel to hide pinned plugin and restore it #group1': function (browser: NightwatchBrowser) {
29+
'Toggle right side panel to hide and show pinned plugin #group1': function (browser: NightwatchBrowser) {
3030
browser
3131
.waitForElementVisible('*[data-id="hideRightSidePanel"]')
3232
.click('*[data-id="hideRightSidePanel"]')
3333
.waitForElementNotVisible('*[data-pinnedplugin="movePluginToLeft-solidity"]')
34-
.waitForElementVisible('*[data-id="restoreClosedPlugin"')
35-
.click('*[data-id="restoreClosedPlugin"]')
34+
.click('*[data-id="toggleRightSidePanel"]')
3635
.waitForElementVisible('*[data-pinnedplugin="movePluginToLeft-solidity"]')
3736
},
3837
'Toggle right side panel, reload IDE, panel state should persist #group1': function (browser: NightwatchBrowser) {
3938
browser
4039
.waitForElementVisible('*[data-id="hideRightSidePanel"]')
4140
.click('*[data-id="hideRightSidePanel"]')
4241
.waitForElementNotVisible('*[data-pinnedplugin="movePluginToLeft-solidity"]')
43-
.waitForElementVisible('*[data-id="restoreClosedPlugin"')
4442
.refresh()
45-
.waitForElementVisible('*[data-id="restoreClosedPlugin"')
46-
.click('*[data-id="restoreClosedPlugin"]')
43+
.waitForElementVisible('*[data-id="toggleRightSidePanel"')
44+
.click('*[data-id="toggleRightSidePanel"]')
4745
.waitForElementVisible('*[data-pinnedplugin="movePluginToLeft-solidity"]')
4846
},
4947
'Swap pinned plugin from right side panel when panel is hidden #group1': function (browser: NightwatchBrowser) {
@@ -52,7 +50,6 @@ module.exports = {
5250
.waitForElementVisible('*[data-pinnedplugin="movePluginToLeft-solidity"]')
5351
.waitForElementVisible('*[data-id="hideRightSidePanel"]')
5452
.click('*[data-id="hideRightSidePanel"]')
55-
.waitForElementVisible('*[data-id="restoreClosedPlugin"]')
5653
.clickLaunchIcon('udapp')
5754
.waitForElementVisible('*[data-pinnedplugin="movePluginToRight-udapp"]')
5855
.click('*[data-id="movePluginToRight"]')

apps/remix-ide/src/app/components/right-side-panel.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,22 @@ export class RightSidePanel extends AbstractPanel {
151151

152152
togglePanel () {
153153
const pinnedPanel = document.querySelector('#right-side-panel')
154+
// Persist the hidden state to panelStates, preserving pluginProfile
155+
const panelStates = JSON.parse(window.localStorage.getItem('panelStates') || '{}')
156+
const currentPlugin = this.currentFocus()
157+
const pluginProfile = currentPlugin && this.plugins[currentPlugin] ? this.plugins[currentPlugin].profile : null
154158
if (this.isHidden) {
155159
this.isHidden = false
156160
pinnedPanel?.classList.remove('d-none')
157161
this.emit('rightSidePanelShown')
158162
this.events.emit('rightSidePanelShown')
159163
} else {
160164
this.isHidden = true
165+
this.hiddenPlugin = pluginProfile
161166
pinnedPanel?.classList.add('d-none')
162167
this.emit('rightSidePanelHidden')
163168
this.events.emit('rightSidePanelHidden')
164169
}
165-
// Persist the hidden state to panelStates, preserving pluginProfile
166-
const panelStates = JSON.parse(window.localStorage.getItem('panelStates') || '{}')
167-
const currentPlugin = this.currentFocus()
168-
const pluginProfile = currentPlugin && this.plugins[currentPlugin] ? this.plugins[currentPlugin].profile : null
169170
panelStates.rightSidePanel = {
170171
isHidden: this.isHidden,
171172
pluginProfile: pluginProfile

0 commit comments

Comments
 (0)