mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
test(cli): drop empty-selection warning assertion from setup test
The empty-selection retry/warning loop in `chooseDrivers` was removed in favor of `multiselect`'s `required: true`, so the legacy warning string is unreachable. Update the test to assert the simpler back-from-selection return-to-embeddings flow.
This commit is contained in:
parent
ec864ab45b
commit
f685a8a53d
1 changed files with 2 additions and 6 deletions
|
|
@ -1094,7 +1094,7 @@ describe('setup status', () => {
|
|||
expect(embeddings).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('lets Back from database selection return to embedding setup after an empty selection warning', async () => {
|
||||
it('lets Back from database selection return to embedding setup', async () => {
|
||||
const testIo = makeIo();
|
||||
const modelResults = [
|
||||
{ status: 'ready' as const, projectDir: tempDir },
|
||||
|
|
@ -1106,9 +1106,8 @@ describe('setup status', () => {
|
|||
{ status: 'back' as const, projectDir: tempDir },
|
||||
];
|
||||
const embeddings = vi.fn(async () => embeddingResults.shift() ?? { status: 'back' as const, projectDir: tempDir });
|
||||
const databaseMultiselectValues = [[], ['back']];
|
||||
const databasePrompts = {
|
||||
multiselect: vi.fn(async () => databaseMultiselectValues.shift() ?? ['back']),
|
||||
multiselect: vi.fn(async () => ['back']),
|
||||
select: vi.fn(async () => 'back'),
|
||||
text: vi.fn(),
|
||||
password: vi.fn(),
|
||||
|
|
@ -1142,9 +1141,6 @@ describe('setup status', () => {
|
|||
).resolves.toBe(0);
|
||||
|
||||
expect(databasePrompts.select).not.toHaveBeenCalled();
|
||||
expect(testIo.stdout()).toContain(
|
||||
'KTX cannot work without at least one database. Select a database or press Escape to go back.',
|
||||
);
|
||||
expect(embeddings).toHaveBeenCalledTimes(2);
|
||||
expect(embeddings).toHaveBeenNthCalledWith(2, expect.objectContaining({ forcePrompt: true }), testIo.io);
|
||||
expect(testIo.stderr()).not.toContain('No databases selected.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue