make test results look better

This commit is contained in:
Michael Q Larson
2015-01-25 10:35:41 -08:00
parent 6503c108bb
commit fa5a1a8618
2 changed files with 25 additions and 11 deletions

View File

@ -2,8 +2,9 @@
@import "lib/bootstrap-social/bootstrap-social"; @import "lib/bootstrap-social/bootstrap-social";
@import "lib/ionicons/ionicons"; @import "lib/ionicons/ionicons";
@import "lib/animate.min.less"; @import "lib/animate.min.less";
@import "lib/bootstrap/variables";
@import url(http://fonts.googleapis.com/css?family=Lato:300); //fonts.googleapis.com/css?family=Lato:300);
@import url(http://fonts.googleapis.com/css?family=Lato:400); @import url(http://fonts.googleapis.com/css?family=Lato:400);
@import url(http://fonts.googleapis.com/css?family=Inconsolata); @import url(http://fonts.googleapis.com/css?family=Inconsolata);
@ -545,6 +546,21 @@ form.code span {
height: auto; height: auto;
} }
.big-error-icon {
font-size: 32px;
color: @brand-danger;
}
.big-success-icon {
font-size: 32px;
color: @brand-primary;
}
.test-output {
font-size: 14px;
font-family: "Ubuntu Mono";
}
#mainEditorPanel .panel-body { #mainEditorPanel .panel-body {
padding-bottom: 0px; padding-bottom: 0px;
} }
@ -579,6 +595,10 @@ div.CodeMirror-scroll {
margin-bottom: 5px; margin-bottom: 5px;
} }
.test-vertical-center {
margin: 8px;
}
//uncomment this to see the dimensions of all elements outlined in red //uncomment this to see the dimensions of all elements outlined in red
//* { //* {
// border-color: red; // border-color: red;

View File

@ -176,19 +176,13 @@ var createTestDisplay = function() {
for (var i = 0; i < userTests.length;i++) { for (var i = 0; i < userTests.length;i++) {
var test = userTests[i]; var test = userTests[i];
var testDoc = document.createElement("li"); var testDoc = document.createElement("li");
$(testDoc)
//.addClass('list-group-item')
//.addClass('well img-rounded')
//.addClass('well-sm')
if (test.err != null) { if (test.err != null) {
$(testDoc) $(testDoc)
.html(test.text + "\n" + test.err) .html("<i class='ion-close-circled big-error-icon col-xs-2'></i>" + test.text + "\n" + test.err).addClass('test-output col-xs-10')
.css("text-color", 'rgba(255,0,0,.2)') .prependTo($('#testSuite'))
.prependTo($('#testSuite'));
} else { } else {
$(testDoc) $(testDoc)
.html(test.text) .html("<i class='ion-checkmark-circled big-success-icon col-xs-2'></i><div class='test-vertical-center'>" + test.text + "</div>").addClass('test-output col-xs-10')
.css('text-color', 'rgba(0,255,0,.2)')
.appendTo($('#testSuite')); .appendTo($('#testSuite'));
} }
}; };
@ -208,7 +202,7 @@ var runTests = function(err, data) {
pushed = false; pushed = false;
$('#testSuite').children().remove(); $('#testSuite').children().remove();
if (err && userTests.length > 0) { if (err && userTests.length > 0) {
userTests= [{text:"Program Execution Failure", err: "NouserTestswere run."}]; userTests= [{text:"Program Execution Failure", err: "No user tests were run."}];
createTestDisplay(); createTestDisplay();
} else if (userTests) { } else if (userTests) {