mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: tighten twitch setup validation assertions
This commit is contained in:
@@ -113,11 +113,11 @@ describe("setup surface helpers", () => {
|
||||
const result = await promptUsername(mockPrompter, null);
|
||||
|
||||
expect(result).toBe("mybot");
|
||||
expect(mockPromptText).toHaveBeenCalledWith({
|
||||
message: "Twitch bot username",
|
||||
initialValue: "",
|
||||
validate: expect.any(Function),
|
||||
});
|
||||
const promptArgs = mockPromptText.mock.calls[0]?.[0];
|
||||
expect(promptArgs?.message).toBe("Twitch bot username");
|
||||
expect(promptArgs?.initialValue).toBe("");
|
||||
expect(promptArgs?.validate?.("")).toBe("Required");
|
||||
expect(promptArgs?.validate?.("mybot")).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -128,11 +128,11 @@ describe("setup surface helpers", () => {
|
||||
const result = await promptClientId(mockPrompter, null);
|
||||
|
||||
expect(result).toBe("abc123xyz");
|
||||
expect(mockPromptText).toHaveBeenCalledWith({
|
||||
message: "Twitch Client ID",
|
||||
initialValue: "",
|
||||
validate: expect.any(Function),
|
||||
});
|
||||
const promptArgs = mockPromptText.mock.calls[0]?.[0];
|
||||
expect(promptArgs?.message).toBe("Twitch Client ID");
|
||||
expect(promptArgs?.initialValue).toBe("");
|
||||
expect(promptArgs?.validate?.("")).toBe("Required");
|
||||
expect(promptArgs?.validate?.("abc123xyz")).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user