Skip to content

Commit

Permalink
V12 Get unit tests to run
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed Sep 13, 2018
1 parent 567e2ea commit d20f2e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
2 changes: 2 additions & 0 deletions src/nouislider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2590,6 +2590,8 @@

// Use an object instead of a function for future expandability;
return {
// Exposed for unit testing, don't use this in your application.
__spectrum: Spectrum,
version: VERSION,
create: initialize
};
Expand Down
34 changes: 3 additions & 31 deletions tests/range.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<link href="http://code.jquery.com/qunit/qunit-1.12.0.css" rel="stylesheet">
<script src="http://code.jquery.com/qunit/qunit-1.12.0.js"></script>

<script src="../src/js/helpers.js"></script>
<script src="../src/js/range.js"></script>
<script src="../src/nouislider.js"></script>
</head>

<body>
Expand All @@ -17,7 +16,7 @@

test( "Standard range", function(){

var subject = new Spectrum({
var subject = new noUiSlider.__spectrum({
min: 0,
max: 100
}, false);
Expand All @@ -27,23 +26,10 @@
equal(subject.convert(50.2), 50.2);
equal(subject.convert(100), 100);
});
/*
test( "Standard RTL", function(){

var subject = new Spectrum({
min: 0,
max: 100
}, false, true);
equal(subject.convert(0), 100);
equal(subject.convert(10), 90);
equal(subject.convert(50.2), 49.8);
equal(subject.convert(100), 0);
});
*/
test( "Standard step", function(){

var subject = new Spectrum({
var subject = new noUiSlider.__spectrum({
min: 0,
max: 100
}, false, 15);
Expand All @@ -54,20 +40,6 @@
equal(subject.convert(95), 90);
equal(subject.convert(100), 100);
});
/*
test( "Standard step RTL", function(){

var subject = new Spectrum({
min: 0,
max: 100
}, false, true, 15);
equal(subject.convert(0), 100 - 0);
equal(subject.convert(10), 100 - 15);
equal(subject.convert(50.2), 100 - 45);
equal(subject.convert(95), 100 - 90);
equal(subject.convert(100), 100 - 100);
});
*/
</script>
</body>

0 comments on commit d20f2e6

Please sign in to comment.