GHHG10/CodeServer / opencode /packages /ui /src /components /scroll-view.test.ts
GHHG10's picture
download
raw
854 Bytes
import { describe, expect, test } from "bun:test"
import { scrollKey } from "./scroll-view"
describe("scrollKey", () => {
test("maps plain navigation keys", () => {
expect(scrollKey({ key: "PageDown", altKey: false, ctrlKey: false, metaKey: false, shiftKey: false })).toBe(
"page-down",
)
expect(scrollKey({ key: "ArrowUp", altKey: false, ctrlKey: false, metaKey: false, shiftKey: false })).toBe("up")
})
test("ignores modified keybinds", () => {
expect(
scrollKey({ key: "ArrowDown", altKey: false, ctrlKey: false, metaKey: true, shiftKey: false }),
).toBeUndefined()
expect(scrollKey({ key: "PageUp", altKey: false, ctrlKey: true, metaKey: false, shiftKey: false })).toBeUndefined()
expect(scrollKey({ key: "End", altKey: false, ctrlKey: false, metaKey: false, shiftKey: true })).toBeUndefined()
})
})

Xet Storage Details

Size:
854 Bytes
·
Xet hash:
9eb7a0ed70ad53fc57ed951c5970f277ad3d7262b6bef3d12ac8d9c5e762a2cc

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.