Skip to content

Commit 0bb13f3

Browse files
Improve the appearance of the test suite in IE6-7.
1 parent f3ecfb8 commit 0bb13f3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

test.new/static/js/test_helpers.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11

22
(function () {
3+
// Needed because Mocha's HTML test runner assumes the presence of
4+
// String#trim.
5+
if (!String.prototype.trim) {
6+
String.prototype.trim = String.prototype.strip;
7+
}
38

49
var CONSOLE_LOG_SUPPORTED = ('console' in window) && console.log;
510
var CONSOLE_GROUP_SUPPORTED = ('console' in window) && console.group &&
611
console.groupEnd;
712
var CONSOLE_LOG_APPLY = true;
813

14+
// TODO: Find a different way to log info in IE6.
915
function info() {
1016
if (CONSOLE_LOG_APPLY) {
1117
console.log.apply(console, arguments);
@@ -274,6 +280,8 @@
274280
return;
275281
}
276282

283+
$('mocha').addClassName('done');
284+
277285
if (!resultsUrl) {
278286
return;
279287
}

test.new/views/layout.erb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
border: 2px solid #eee;
1818
}
1919

20+
/* Older IEs don't support CANVAS, so we need something other than the progress indicator to show that we're done. */
21+
#mocha.done {
22+
border-color: #090;
23+
}
24+
2025
#mocha-stats {
2126
background: #fff;
2227
}
@@ -36,6 +41,20 @@
3641
}
3742
</style>
3843

44+
<!--[if lt IE 8]>
45+
<style type="text/css" media="screen">
46+
47+
#mocha-stats {
48+
position: static;
49+
}
50+
51+
#mocha-stats li {
52+
float: left;
53+
}
54+
55+
</style>
56+
<![endif]-->
57+
3958
<script src="/prototype.js?<%= @unique_asset_string %>" type="text/javascript"></script>
4059
<script src="/js/mocha.js?<%= @unique_asset_string %>" type="text/javascript"></script>
4160
<script src="/js/proclaim.js?<%= @unique_asset_string %>" type="text/javascript"></script>

0 commit comments

Comments
 (0)