Skip to content

Commit 3fd0211

Browse files
test(ModelManager): increase time.tick to harden flaky tests
1 parent e5c2def commit 3fd0211

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/components/ModelManager/ModelManager.test.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ describe('ModelManager', () => {
323323

324324
const props = getLastSelectProps();
325325
props.onChange?.('switch');
326-
await time.tick(10);
326+
await time.tick(20);
327327

328328
expect(lastFrame()).toContain('Loading models');
329329

@@ -388,7 +388,7 @@ describe('ModelManager', () => {
388388

389389
const props = getLastSelectProps();
390390
props.onChange?.('download');
391-
await time.tick(10);
391+
await time.tick(20);
392392

393393
const frame = lastFrame() ?? '';
394394
expect(frame).not.toContain('Qwen 2.5 Coder');
@@ -460,7 +460,7 @@ describe('ModelManager', () => {
460460

461461
props = getLastSelectProps();
462462
props.onChange?.('qwen2.5-coder:7b');
463-
await time.tick(10);
463+
await time.tick(20);
464464

465465
expect(lastFrame()).toContain('verifying');
466466
expect(lastFrame()).toContain('100%');
@@ -506,7 +506,7 @@ describe('ModelManager', () => {
506506

507507
let props = getLastSelectProps();
508508
props.onChange?.('download');
509-
await time.tick(10);
509+
await time.tick(20);
510510

511511
props = getLastSelectProps();
512512
props.onChange?.('qwen2.5-coder:7b');
@@ -553,7 +553,7 @@ describe('ModelManager', () => {
553553

554554
props = getLastSelectProps();
555555
props.onChange?.('qwen2.5-coder:7b');
556-
await time.tick(10);
556+
await time.tick(20);
557557

558558
expect(lastFrame()).toContain('Choose a model to download');
559559
expect(lastFrame()).toContain('Download canceled');
@@ -644,7 +644,7 @@ describe('ModelManager', () => {
644644

645645
props = getLastSelectProps();
646646
props.onChange?.('qwen2.5-coder:7b');
647-
await time.tick(10);
647+
await time.tick(20);
648648

649649
expect(lastFrame()).toContain('downloading');
650650
expect(lastFrame()).toContain('GB');
@@ -689,7 +689,7 @@ describe('ModelManager', () => {
689689

690690
props = getLastSelectProps();
691691
props.onChange?.('qwen2.5-coder:7b');
692-
await time.tick(10);
692+
await time.tick(20);
693693

694694
expect(lastFrame()).toContain('Downloading model');
695695

@@ -721,7 +721,7 @@ describe('ModelManager', () => {
721721

722722
props = getLastSelectProps();
723723
props.onChange?.('custom');
724-
await time.tick(10);
724+
await time.tick(20);
725725

726726
const textInputProps = getLastTextInputProps();
727727
textInputProps.onSubmit('');
@@ -747,7 +747,7 @@ describe('ModelManager', () => {
747747

748748
props = getLastSelectProps();
749749
props.onChange?.('custom');
750-
await time.tick(10);
750+
await time.tick(20);
751751

752752
const textInputProps = getLastTextInputProps();
753753
textInputProps.onSubmit('gemma4'); // Already installed
@@ -785,7 +785,7 @@ describe('ModelManager', () => {
785785

786786
props = getLastSelectProps();
787787
props.onChange?.('custom');
788-
await time.tick(10);
788+
await time.tick(20);
789789

790790
const textInputProps = getLastTextInputProps();
791791
textInputProps.onSubmit('newmodel');
@@ -834,7 +834,7 @@ describe('ModelManager', () => {
834834

835835
props = getLastSelectProps();
836836
props.onChange?.('custom');
837-
await time.tick(10);
837+
await time.tick(20);
838838

839839
// Simulate typing a value with a colon so the mock ModelSuggestions triggers onSelect
840840
const textInputProps = getLastTextInputProps();
@@ -863,12 +863,12 @@ describe('ModelManager', () => {
863863

864864
props = getLastSelectProps();
865865
props.onChange?.('custom');
866-
await time.tick(10);
866+
await time.tick(20);
867867

868868
// Type a value with ':' so the mock triggers onSelect (sets highlightedSuggestion)
869869
const textInputProps = getLastTextInputProps();
870870
textInputProps.onChange('gemma:latest');
871-
await time.tick(10);
871+
await time.tick(20);
872872

873873
// Submit triggers pull with the highlighted suggestion
874874
const updatedTextInputProps = getLastTextInputProps();
@@ -948,7 +948,7 @@ describe('ModelManager', () => {
948948

949949
let props = getLastSelectProps();
950950
props.onChange?.('delete');
951-
await time.tick(10);
951+
await time.tick(20);
952952

953953
props = getLastSelectProps();
954954
expect(props.options.map((option) => option.value)).not.toContain(
@@ -1029,7 +1029,7 @@ describe('ModelManager', () => {
10291029

10301030
props = getLastSelectProps();
10311031
props.onChange?.('delete');
1032-
await time.tick(10);
1032+
await time.tick(20);
10331033

10341034
expect(lastFrame()).toContain('Error deleting model');
10351035
expect(lastFrame()).toContain('Delete failed');
@@ -1169,7 +1169,7 @@ describe('ModelManager', () => {
11691169

11701170
props = getLastSelectProps();
11711171
props.onChange?.('llama3');
1172-
await time.tick(10);
1172+
await time.tick(30);
11731173

11741174
expect(lastFrame()).toContain('Delete model llama3');
11751175

0 commit comments

Comments
 (0)