GHHG10/CodeServer / opencode /packages /app /src /utils /notification-click.test.ts
GHHG10's picture
download
raw
878 Bytes
import { afterEach, describe, expect, test } from "bun:test"
import { handleNotificationClick, setNavigate } from "./notification-click"
describe("notification click", () => {
afterEach(() => {
setNavigate(undefined as any)
})
test("navigates via registered navigate function", () => {
const calls: string[] = []
setNavigate((href) => calls.push(href))
handleNotificationClick("/abc/session/123")
expect(calls).toEqual(["/abc/session/123"])
})
test("does not navigate when href is missing", () => {
const calls: string[] = []
setNavigate((href) => calls.push(href))
handleNotificationClick(undefined)
expect(calls).toEqual([])
})
test("falls back to location.assign without registered navigate", () => {
handleNotificationClick("/abc/session/123")
// falls back to window.location.assign — no error thrown
})
})

Xet Storage Details

Size:
878 Bytes
·
Xet hash:
2c3193141763d9fc6ab48b6919b1dff6065d3dd4e6d0be76c6a3e92ae531d46c

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