Skip to content

Commit ffb2195

Browse files
committed
Progress on tests
1 parent e66f3b0 commit ffb2195

17 files changed

+559
-151
lines changed

simulator/css/LogicEditor.css

Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -584,40 +584,49 @@ svg text {
584584
color: rgb(220, 220, 220);
585585
}
586586

587-
588-
.test-suite {
589-
background-color: #ccc;
590-
color: #444;
591-
font-weight: bold;
587+
.test-disclosable {
592588
cursor: pointer;
593-
padding: 5px;
594-
width: 100%;
595589
border: none;
596-
font-size: 12px;
597590
}
598591

599-
.test-suite::before {
592+
.test-disclosable::before {
600593
content: '\25B6';
601594
/* Right-pointing triangle */
602595
display: inline-block;
603596
margin-right: 5px;
604597
transition: transform 0.1s;
605598
}
606599

607-
.test-suite.expanded::before {
600+
.testcase-button {
601+
background: none;
602+
width: 100%;
603+
text-align: left;
604+
}
605+
606+
.testcase-button.test-disclosable::before {
607+
font-size: 80%;
608+
}
609+
610+
.test-disclosable.expanded::before {
608611
transform: rotate(90deg);
609612
/* Down-pointing triangle */
610613
}
611614

615+
.test-suite {
616+
background-color: #ccc;
617+
color: #444;
618+
font-weight: bold;
619+
padding: 5px;
620+
width: 100%;
621+
}
622+
612623
.test-cases {
613624
padding: 0;
614625
display: none;
615626
overflow: hidden;
616627
background-color: #f1f1f1;
617628
}
618629

619-
620-
621630
.testcase {
622631
padding: 2px 5px;
623632
}
@@ -644,11 +653,11 @@ svg text {
644653

645654
.testcase.running {
646655
background: repeating-linear-gradient(135deg,
647-
#d3d3d3,
648-
#d3d3d3 10px,
649-
#f1f1f1 10px,
650-
#f1f1f1 20px);
651-
background-size: 200% 200%;
656+
#e2e2e2,
657+
#e2e2e2 10px,
658+
#f7f6f6 10px,
659+
#f7f6f6 20px);
660+
background-size: 200% 100%;
652661
animation: barberpole 5s linear infinite;
653662
}
654663

@@ -662,22 +671,36 @@ svg text {
662671
}
663672
}
664673

665-
/* .testresult-wait::before {
666-
content: '\231B';
667-
Hourglass
668-
display: inline-block;
669-
margin-right: 10px;
670-
font-size: 10px;
671-
animation: spin 1s linear infinite;
674+
.testcase-details {
675+
padding: 5px 5px 10px 20px;
672676
}
673677

678+
.testcase-table {
679+
width: 100%;
680+
font-size: 90%;
681+
border-collapse: collapse;
682+
border-bottom: 1px solid rgba(255, 255, 255, 0.6);
683+
border-left: 2px solid rgba(255, 255, 255, 0.6);
684+
opacity: 0.8;
685+
}
674686

675-
@keyframes spin {
676-
0% {
677-
transform: rotate(0deg);
678-
}
687+
.testcase-table th {
688+
padding-left: 5px;
689+
}
679690

680-
100% {
681-
transform: rotate(360deg);
682-
}
683-
} */
691+
.testcase-table td {
692+
padding-left: 10px;
693+
}
694+
695+
.testcase-table :is(td, th):first-child {
696+
width: 50%;
697+
}
698+
699+
.testcase-table :is(td, th):nth-child(2) {
700+
border-left: 1px solid rgba(255, 255, 255, 0.6);
701+
}
702+
703+
.testcase-wrongvalue {
704+
color: #8f2626;
705+
font-weight: bold;
706+
}

simulator/html/LogicEditorTemplate.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@
3030
</div>
3131
</div>
3232

33-
<div id="testResultsPalette" class="sim-toolbar-right" style="display: none; padding-bottom: 2px;" data-prev-display="block">
34-
<div id="testResultsContainer" style="width: 100%; font-size: 80%;"></div>
33+
<div id="testResultsPalette">
3534
</div>
3635

3736
<div id="settingsPalette" class="sim-toolbar-right" style="display: none; flex-direction:column; align-items: stretch; font-size: 75%; padding: 0 5px 5px" data-prev-display="flex">
38-
3937
</div>
4038

4139

42-
4340
</div>
4441
</div>
4542

simulator/img/icons/setinput.icon.svg

Lines changed: 1 addition & 0 deletions
Loading

simulator/src/ComponentFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export class ComponentFactory {
397397
return s.ComponentAlreadyExists.expand({ id })
398398
}
399399

400-
const { components, wires } = Serialization.buildComponentsAndWireObject(componentsToInclude, undefined)
400+
const { components, wires } = Serialization.buildComponentsAndWireObject(componentsToInclude, [], undefined)
401401
if (components === undefined || wires === undefined) {
402402
return s.NoWires
403403
}
@@ -433,7 +433,7 @@ export class ComponentFactory {
433433

434434
const newComponents = checkResult.components
435435

436-
const circuit = Serialization.buildComponentsAndWireObject(newComponents, undefined)
436+
const circuit = Serialization.buildComponentsAndWireObject(newComponents, [], undefined)
437437
if (circuit.components === undefined || circuit.wires === undefined) {
438438
return ""
439439
}

0 commit comments

Comments
 (0)