Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(361)

Unified Diff: test/test_environment_view.js

Issue 7609043: Fix IE nitpicks
Patch Set: Created 12 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/test_charm_panel.js ('k') | test/test_panzoom.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/test_environment_view.js
=== modified file 'test/test_environment_view.js'
--- test/test_environment_view.js 2013-03-06 05:48:13 +0000
+++ test/test_environment_view.js 2013-03-07 22:22:10 +0000
@@ -84,7 +84,7 @@
Y = YUI(GlobalConfig).use([
'juju-views', 'juju-tests-utils', 'juju-env',
'node-event-simulate', 'juju-gui', 'slider',
- 'landscape'
+ 'landscape', 'dump'
], function(Y) {
testUtils = Y.namespace('juju-tests.utils');
views = Y.namespace('juju.views');
@@ -379,6 +379,12 @@
op: 'delta'
};
+ function floor(o) {
+ return Math.floor(parseFloat(o.toString()));
+ }
+ function cmp(a, b) {
+ return floor(a) === floor(b);
+ }
// Ensure that line endpoints match with calculated endpoints.
function endpointsCalculatedProperly(relation) {
var node = d3.select(relation);
@@ -387,10 +393,10 @@
var connectors = boxpair.source
.getConnectorPair(boxpair.target);
- return parseFloat(line.attr('x1')) === connectors[0][0] &&
- parseFloat(line.attr('y1')) === connectors[0][1] &&
- parseFloat(line.attr('x2')) === connectors[1][0] &&
- parseFloat(line.attr('y2')) === connectors[1][1];
+ return cmp(line.attr('x1'), connectors[0][0]) &&
+ cmp(line.attr('y1'), connectors[0][1]) &&
+ cmp(line.attr('x2'), connectors[1][0]) &&
+ cmp(line.attr('y2'), connectors[1][1]);
}
// Ensure that endpoints match for all services before any
@@ -438,7 +444,7 @@
],
op: 'delta'
},
- properTransform = /translate\(\d+\.?\d*,\d+\.?\d*\)/;
+ properTransform = /translate\(\d+\.?\d*[, ]\d+\.?\d*\)/;
view.render();
container.all('.service').each(function(serviceNode) {
@@ -482,7 +488,8 @@
'id': 'wordpress',
'annotations': {'gui.x': 374.1, 'gui.y': 211.2}
}]]};
- var properTransform = /translate\((\d+\.?\d*),(\d+\.?\d*)\)/;
+ // IE uses a space delimiter, not a comma.
+ var properTransform = /translate\((\d+\.?\d*)[, ](\d+\.?\d*)\)/;
var node, match;
view.render();
« no previous file with comments | « test/test_charm_panel.js ('k') | test/test_panzoom.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b