Skip to content

Commit e3589aa

Browse files
test(components): harden tests by increasing timeout
1 parent 9f8c95e commit e3589aa

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/components/Chat/FileSuggestions.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ describe('FileSuggestions', () => {
267267

268268
await time.tick(20);
269269
stdin.write(KEY.TAB);
270-
await time.tick();
270+
await time.tick(20);
271271

272272
// Should be 'see src/components/App.tsx hello' (single space, not double)
273273
// Cursor position is right after 'see src/components/App.tsx ' (before 'hello')

src/components/ModelManager/ModelManager.test.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,8 @@ describe('ModelManager', () => {
686686

687687
props = getLastSelectProps();
688688
props.onChange?.('qwen2.5-coder:7b');
689-
await time.tick(10);
689+
await time.tick(); // flush microtasks
690+
await time.tick(30);
690691

691692
expect(lastFrame()).toContain('Downloading model');
692693

@@ -718,11 +719,12 @@ describe('ModelManager', () => {
718719

719720
props = getLastSelectProps();
720721
props.onChange?.('custom');
721-
await time.tick(10);
722+
await time.tick(20);
722723

723724
const textInputProps = getLastTextInputProps();
724725
textInputProps.onSubmit('');
725-
await time.tick(10);
726+
await time.tick(); // flush microtasks
727+
await time.tick(30);
726728

727729
expect(lastFrame()).toContain('Enter an Ollama model name to download.');
728730
});
@@ -744,7 +746,7 @@ describe('ModelManager', () => {
744746

745747
props = getLastSelectProps();
746748
props.onChange?.('custom');
747-
await time.tick(10);
749+
await time.tick(20);
748750

749751
const textInputProps = getLastTextInputProps();
750752
textInputProps.onSubmit('gemma4'); // Already installed
@@ -782,7 +784,7 @@ describe('ModelManager', () => {
782784

783785
props = getLastSelectProps();
784786
props.onChange?.('custom');
785-
await time.tick(10);
787+
await time.tick(20);
786788

787789
const textInputProps = getLastTextInputProps();
788790
textInputProps.onSubmit('newmodel');
@@ -809,7 +811,7 @@ describe('ModelManager', () => {
809811

810812
props = getLastSelectProps();
811813
props.onChange?.('custom');
812-
await time.tick(10);
814+
await time.tick(20);
813815

814816
expect(lastFrame()).toContain('Suggestions:');
815817
});
@@ -831,7 +833,7 @@ describe('ModelManager', () => {
831833

832834
props = getLastSelectProps();
833835
props.onChange?.('custom');
834-
await time.tick(10);
836+
await time.tick(20);
835837

836838
// Simulate typing a value with a colon so the mock ModelSuggestions triggers onSelect
837839
const textInputProps = getLastTextInputProps();

0 commit comments

Comments
 (0)