GHHG10/CodeServer / opencode /packages /app /src /pages /session /file-tab-scroll.test.ts
GHHG10's picture
download
raw
965 Bytes
import { describe, expect, test } from "bun:test"
import { nextTabListScrollLeft } from "./file-tab-scroll"
describe("nextTabListScrollLeft", () => {
test("does not scroll when width shrinks", () => {
const left = nextTabListScrollLeft({
prevScrollWidth: 500,
scrollWidth: 420,
clientWidth: 300,
prevContextOpen: false,
contextOpen: false,
})
expect(left).toBeUndefined()
})
test("scrolls to start when context tab opens", () => {
const left = nextTabListScrollLeft({
prevScrollWidth: 400,
scrollWidth: 500,
clientWidth: 320,
prevContextOpen: false,
contextOpen: true,
})
expect(left).toBe(0)
})
test("scrolls to right edge for new file tabs", () => {
const left = nextTabListScrollLeft({
prevScrollWidth: 500,
scrollWidth: 780,
clientWidth: 300,
prevContextOpen: true,
contextOpen: true,
})
expect(left).toBe(480)
})
})

Xet Storage Details

Size:
965 Bytes
·
Xet hash:
3e57a4cf0f00a04b9c423df086575df7d01cd9d7c72a5659fd7ffc35bd955585

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