Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

clean up play button style

TJ Holowaychukfee04151eba3
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index 47270147..dde6c04e 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -134,11 +134,11 @@ function HTML(runner, root) {
//test
if ('passed' == test.state) {
- var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="?grep=%e" class="replay">&#9654;</a></h2></li>', test.speed, test.title, test.duration, test.fullTitle());
+ var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="?grep=%e" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, test.fullTitle());
} else if (test.pending) {
var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
} else {
- var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">&#9654;</a></h2></li>', test.title, test.fullTitle());
+ var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">‣</a></h2></li>', test.title, test.fullTitle());
var str = test.err.stack || test.err.toString();
// FF / Opera do not add the message
diff --git a/mocha.css b/mocha.css
index 0596a0dc..724ac3c8 100644
--- a/mocha.css
+++ b/mocha.css
@@ -55,16 +55,6 @@ body {
margin-left: 15px;
}
-#mocha .test:hover h2::after {
- position: relative;
- top: 0;
- right: -10px;
- content: '(view source)';
- font-size: 12px;
- font-family: arial;
- color: #888;
-}
-
#mocha .test.pending:hover h2::after {
content: '(pending)';
font-family: arial;
@@ -147,12 +137,38 @@ body {
border-bottom-color: #ddd;
-webkit-border-radius: 3px;
-webkit-box-shadow: 0 1px 3px #eee;
+ -moz-border-radius: 3px;
+ -moz-box-shadow: 0 1px 3px #eee;
+}
+
+#mocha .test h2 {
+ position: relative;
+}
+
+#mocha .test a.replay {
+ position: absolute;
+ top: 3px;
+ right: -20px;
+ text-decoration: none;
+ vertical-align: middle;
+ display: block;
+ width: 15px;
+ height: 15px;
+ line-height: 15px;
+ text-align: center;
+ background: #eee;
+ font-size: 15px;
+ -moz-border-radius: 15px;
+ border-radius: 15px;
+ -webkit-transition: opacity 200ms;
+ -moz-transition: opacity 200ms;
+ transition: opacity 200ms;
+ opacity: 0.2;
+ color: #888;
}
-#mocha .test a, #mocha .test a:visited {
- text-decoration: none;
- vertical-align: middle;
- color: green;
+#mocha .test:hover a.replay {
+ opacity: 1;
}
#report.pass .test.fail {
diff --git a/mocha.js b/mocha.js
index fd5677d8..bbfd850b 100644
--- a/mocha.js
+++ b/mocha.js
@@ -2005,11 +2005,11 @@ function HTML(runner, root) {
//test
if ('passed' == test.state) {
- var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="?grep=%e" class="replay">&#9654;</a></h2></li>', test.speed, test.title, test.duration, test.fullTitle());
+ var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="?grep=%e" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, test.fullTitle());
} else if (test.pending) {
var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
} else {
- var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">&#9654;</a></h2></li>', test.title, test.fullTitle());
+ var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">‣</a></h2></li>', test.title, test.fullTitle());
var str = test.err.stack || test.err.toString();
// FF / Opera do not add the message