mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-09 18:29:39 +00:00
17 lines
487 B
TypeScript
17 lines
487 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { messageIdFromHash } from "./use-session-hash-scroll"
|
|
|
|
describe("messageIdFromHash", () => {
|
|
test("parses hash with leading #", () => {
|
|
expect(messageIdFromHash("#message-abc123")).toBe("abc123")
|
|
})
|
|
|
|
test("parses raw hash fragment", () => {
|
|
expect(messageIdFromHash("message-42")).toBe("42")
|
|
})
|
|
|
|
test("ignores non-message anchors", () => {
|
|
expect(messageIdFromHash("#review-panel")).toBeUndefined()
|
|
})
|
|
})
|