Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

test(plugins): menu section tests for the flatter layout

Salman Qureshidb81c6da97ba
diff --git a/src/plugins/lifecycle.test.ts b/src/plugins/lifecycle.test.ts
index 58ec694d..a1e79e76 100644
--- a/src/plugins/lifecycle.test.ts
+++ b/src/plugins/lifecycle.test.ts
@@ -312,7 +312,7 @@ describe('menu sections and "ask only while missing"', () => {
await d.answer('+15550001111');
expect(await text()).toMatch(/is set up/);
const menu = await open('menu');
- expect(await menu.text()).toMatch(/πŸŽ™ Voice calls: ready βœ“ \(⭐ OpenAI/);
+ expect(await menu.text()).toMatch(/πŸŽ™ Voice calls: OpenAI βœ“/);
} finally {
setProviderLookup(() => undefined);
}
@@ -332,7 +332,7 @@ describe('menu sections and "ask only while missing"', () => {
expect((await mgr.info('voicey'))?.missing?.[0].fix).toMatch(/Or pick another voice in Voice calls\./);
const menu = await open('menu');
- expect(await menu.text()).toMatch(/πŸŽ™ Voice calls: not set up ⚠[\s\S]*πŸŽ™ Voice calls ⚠ set up/);
+ expect(await menu.text()).toMatch(/πŸŽ™ Voice calls: OpenAI ⚠ needs setup/);
// Choosing Gemini in the section asks for its key; until then it isn't ready.
await mgr.setSetting('voicey', 'engine', 'gemini');
expect((await mgr.info('voicey'))?.settingGroups?.[0].ready).toBe(false);
@@ -343,14 +343,15 @@ describe('menu sections and "ask only while missing"', () => {
}
});
- it('the section walks through only what applies', async () => {
+ it('the section lists what applies, and a new choice asks for what it needs', async () => {
const { setProviderLookup } = await import('./manager.js');
setProviderLookup(() => undefined);
await mgr.install(inProcessPlugin(src, { id: 'voicey', manifest }));
const { d, text } = await open('menu');
expect(await text()).toMatch(/1\* Β· πŸŽ™ Voice calls/);
await d.answer('1');
- expect(await text()).toMatch(/πŸŽ™ Voice calls[\s\S]*Change it/);
+ expect(await text()).toMatch(/πŸŽ™ Voice calls[\s\S]*1\* Β· Who handles calls\?: OpenAI[\s\S]*Set up step by step[\s\S]*← Back/);
+ expect(await text()).not.toMatch(/Gemini key/); // doesn't apply to OpenAI
await d.answer('1');
expect(await text()).toMatch(/Who handles calls\?/);
await d.answer('2'); // Gemini β†’ now its key