Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license

This commit is contained in:
2026-09-05 13:26:46 +03:00
commit 03634b1ca3
11340 changed files with 3442369 additions and 0 deletions
@@ -0,0 +1,36 @@
import { describe, expect, it, vi } from 'vitest'
import { handleInputSelectionClipboard } from '../app/useInputHandlers.js'
const selection = (start = 1, end = 4) => ({
clear: vi.fn(),
collapseToEnd: vi.fn(),
copy: vi.fn(),
cut: vi.fn(),
end,
start,
value: 'hello'
})
describe('handleInputSelectionClipboard', () => {
it('copies an active composer selection', () => {
const active = selection()
expect(handleInputSelectionClipboard(active, 'copy')).toBe(true)
expect(active.copy).toHaveBeenCalledOnce()
expect(active.cut).not.toHaveBeenCalled()
})
it('cuts an active composer selection', () => {
const active = selection()
expect(handleInputSelectionClipboard(active, 'cut')).toBe(true)
expect(active.cut).toHaveBeenCalledOnce()
expect(active.copy).not.toHaveBeenCalled()
})
it('leaves shortcuts available when there is no active selection', () => {
expect(handleInputSelectionClipboard(null, 'copy')).toBe(false)
expect(handleInputSelectionClipboard(selection(2, 2), 'cut')).toBe(false)
})
})