fix #2783 fix #2780 Fix close button function, fix tab context menu

This commit is contained in:
ZHAO Xudong
2023-03-14 09:45:16 +08:00
parent cae0d7fde1
commit 5a36c8c251
5 changed files with 37 additions and 5 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "electerm",
"version": "1.25.20",
"version": "1.25.22",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "electerm",
"version": "1.25.20",
"version": "1.25.22",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "electerm",
"version": "1.25.20",
"version": "1.25.22",
"description": "Terminal/ssh/telnet/serialport/sftp client(linux, mac, win)",
"main": "app.js",
"bin": "npm/electerm",
+1 -1
View File
@@ -317,7 +317,7 @@ export default class Tab extends React.Component {
const rect = target.getBoundingClientRect()
const items = this.renderContext()
this.uid = generate()
this.props.store.openContextMenu({
window.store.openContextMenu({
items,
pos: {
left: rect.left,
@@ -23,7 +23,7 @@ export default class WindowControl extends Component {
window.pre.runGlobalAsync('unmaximize')
}
const closeApp = () => {
window.StorageEvent.exit()
window.store.exit()
}
return (
<div className='window-controls'>
+32
View File
@@ -0,0 +1,32 @@
/**
* basic ssh test
* need TEST_HOST TEST_PASS TEST_USER env set
*/
const { _electron: electron } = require('playwright')
const {
test: it
} = require('@playwright/test')
const { describe } = it
it.setTimeout(100000)
const { expect } = require('chai')
const delay = require('./common/wait')
const appOptions = require('./common/app-options')
const extendClient = require('./common/client-extend')
describe('ssh', function () {
it('should open window and basic ssh ls command works', async function () {
const electronApp = await electron.launch(appOptions)
const client = await electronApp.firstWindow()
extendClient(client, electronApp)
await delay(4500)
await delay(4500)
await client.rightClick('.tabs .tab', 10, 10)
await client.click('.context-menu.show .anticon-copy')
await delay(4500)
const tabsCount = await client.evaluate(() => {
return window.store.tabs.length
})
expect(tabsCount).equal(2)
})
})