Skip to content

Commit a633155

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

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/components/Chat/FileSuggestions.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ describe('FileSuggestions', () => {
123123

124124
await time.tick(20);
125125
stdin.write(KEY.DOWN);
126-
await time.tick();
126+
await time.tick(10);
127127
stdin.write(KEY.TAB);
128-
await time.tick();
128+
await time.tick(10);
129129

130130
expect(onSelect).toHaveBeenCalledWith({
131131
value: 'read src/components/Input.tsx ',
@@ -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: 7 additions & 6 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(20);
690691

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

@@ -718,7 +719,7 @@ 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('');
@@ -744,7 +745,7 @@ describe('ModelManager', () => {
744745

745746
props = getLastSelectProps();
746747
props.onChange?.('custom');
747-
await time.tick(10);
748+
await time.tick(20);
748749

749750
const textInputProps = getLastTextInputProps();
750751
textInputProps.onSubmit('gemma4'); // Already installed
@@ -782,7 +783,7 @@ describe('ModelManager', () => {
782783

783784
props = getLastSelectProps();
784785
props.onChange?.('custom');
785-
await time.tick(10);
786+
await time.tick(20);
786787

787788
const textInputProps = getLastTextInputProps();
788789
textInputProps.onSubmit('newmodel');
@@ -809,7 +810,7 @@ describe('ModelManager', () => {
809810

810811
props = getLastSelectProps();
811812
props.onChange?.('custom');
812-
await time.tick(10);
813+
await time.tick(20);
813814

814815
expect(lastFrame()).toContain('Suggestions:');
815816
});
@@ -831,7 +832,7 @@ describe('ModelManager', () => {
831832

832833
props = getLastSelectProps();
833834
props.onChange?.('custom');
834-
await time.tick(10);
835+
await time.tick(20);
835836

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

0 commit comments

Comments
 (0)