mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
29 lines
1.1 KiB
Swift
29 lines
1.1 KiB
Swift
import Foundation
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite(.serialized)
|
|
struct SessionMenuPreviewTests {
|
|
@Test func loaderReturnsCachedItems() async {
|
|
await SessionPreviewCache.shared._testReset()
|
|
let items = [SessionPreviewItem(id: "1", role: .user, text: "Hi")]
|
|
let snapshot = SessionMenuPreviewSnapshot(items: items, status: .ready)
|
|
await SessionPreviewCache.shared._testSet(snapshot: snapshot, for: "main")
|
|
|
|
let loaded = await SessionMenuPreviewLoader.load(sessionKey: "main", maxItems: 10)
|
|
#expect(loaded.status == .ready)
|
|
#expect(loaded.items.count == 1)
|
|
#expect(loaded.items.first?.text == "Hi")
|
|
}
|
|
|
|
@Test func loaderReturnsEmptyWhenCachedEmpty() async {
|
|
await SessionPreviewCache.shared._testReset()
|
|
let snapshot = SessionMenuPreviewSnapshot(items: [], status: .empty)
|
|
await SessionPreviewCache.shared._testSet(snapshot: snapshot, for: "main")
|
|
|
|
let loaded = await SessionMenuPreviewLoader.load(sessionKey: "main", maxItems: 10)
|
|
#expect(loaded.status == .empty)
|
|
#expect(loaded.items.isEmpty)
|
|
}
|
|
}
|