feat: release OpsXShell 2.1.0 native Tauri edition
This commit is contained in:
1 parent
e9a0d21758
commit
a3dba0c6ed
311 files changed
+31748
-14897
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
isTerminalCopyShortcut,
|
||||
isTerminalPasteShortcut,
|
||||
isTerminalSplitShortcut,
|
||||
} from '../../src/utils/terminalShortcuts'
|
||||
|
||||
function keyEvent(key: string, init: KeyboardEventInit = {}): KeyboardEvent {
|
||||
return new KeyboardEvent('keydown', { key, ...init })
|
||||
}
|
||||
|
||||
describe('terminal shortcuts', () => {
|
||||
it('uses Cmd+C and Cmd+V on macOS', () => {
|
||||
expect(isTerminalCopyShortcut(keyEvent('c', { metaKey: true }))).toBe(true)
|
||||
expect(isTerminalPasteShortcut(keyEvent('v', { metaKey: true }))).toBe(true)
|
||||
})
|
||||
|
||||
it('uses Ctrl+Shift+C and Ctrl+Shift+V outside macOS', () => {
|
||||
expect(isTerminalCopyShortcut(keyEvent('C', { ctrlKey: true, shiftKey: true }))).toBe(true)
|
||||
expect(isTerminalPasteShortcut(keyEvent('V', { ctrlKey: true, shiftKey: true }))).toBe(true)
|
||||
})
|
||||
|
||||
it('uses Cmd+D for splitting', () => {
|
||||
expect(isTerminalSplitShortcut(keyEvent('d', { metaKey: true }))).toBe(true)
|
||||
})
|
||||
|
||||
it('does not consume Ctrl+D, which must reach the remote shell as EOF', () => {
|
||||
expect(isTerminalSplitShortcut(keyEvent('d', { ctrlKey: true }))).toBe(false)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user