mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
17 lines
626 B
TypeScript
17 lines
626 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { resolveScopedBot } from "./scope.js";
|
|
|
|
describe("resolveScopedBot", () => {
|
|
it("returns null when no id requested", () => {
|
|
expect(resolveScopedBot(null, ["a", "b"])).toBeNull();
|
|
expect(resolveScopedBot(undefined, ["a"])).toBeNull();
|
|
expect(resolveScopedBot("", ["a"])).toBeNull();
|
|
});
|
|
it("returns the id when it exists in the bot list", () => {
|
|
expect(resolveScopedBot("b", ["a", "b"])).toBe("b");
|
|
});
|
|
it("clears (null) when the requested id is not a known bot", () => {
|
|
expect(resolveScopedBot("ghost", ["a", "b"])).toBeNull();
|
|
});
|
|
});
|