Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
i20rzslider
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jedife
i20rzslider
Commits
d3ee61db
Commit
d3ee61db
authored
Dec 25, 2015
by
Valentin Hervieu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: improve test about classes and attributes
parent
4747ab12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
rz-slider-service-test.js
tests/spec/rz-slider-service-test.js
+11
-0
No files found.
tests/spec/rz-slider-service-test.js
View file @
d3ee61db
...
@@ -81,6 +81,7 @@ describe('rzslider - ', function() {
...
@@ -81,6 +81,7 @@ describe('rzslider - ', function() {
expect
(
element
.
find
(
'span'
)).
to
.
have
.
length
(
11
);
expect
(
element
.
find
(
'span'
)).
to
.
have
.
length
(
11
);
expect
(
slider
.
range
).
to
.
be
.
false
;
expect
(
slider
.
range
).
to
.
be
.
false
;
expect
(
slider
.
valueRange
).
to
.
equal
(
100
);
expect
(
slider
.
valueRange
).
to
.
equal
(
100
);
expect
(
slider
.
maxH
.
css
(
'display'
)).
to
.
equal
(
'none'
);
});
});
it
(
'should watch rzSliderModel and reflow the slider accordingly'
,
function
()
{
it
(
'should watch rzSliderModel and reflow the slider accordingly'
,
function
()
{
...
@@ -169,6 +170,7 @@ describe('rzslider - ', function() {
...
@@ -169,6 +170,7 @@ describe('rzslider - ', function() {
expect
(
element
.
find
(
'span'
)).
to
.
have
.
length
(
11
);
expect
(
element
.
find
(
'span'
)).
to
.
have
.
length
(
11
);
expect
(
slider
.
range
).
to
.
be
.
true
;
expect
(
slider
.
range
).
to
.
be
.
true
;
expect
(
slider
.
valueRange
).
to
.
equal
(
100
);
expect
(
slider
.
valueRange
).
to
.
equal
(
100
);
expect
(
slider
.
maxH
.
css
(
'display'
)).
to
.
equal
(
''
);
});
});
it
(
'should watch rzSliderHigh and reflow the slider accordingly'
,
function
()
{
it
(
'should watch rzSliderHigh and reflow the slider accordingly'
,
function
()
{
...
@@ -288,6 +290,7 @@ describe('rzslider - ', function() {
...
@@ -288,6 +290,7 @@ describe('rzslider - ', function() {
expect
(
element
[
0
].
getBoundingClientRect
().
width
).
to
.
equal
(
1000
);
expect
(
element
[
0
].
getBoundingClientRect
().
width
).
to
.
equal
(
1000
);
expect
(
slider
.
positionProperty
).
to
.
equal
(
'left'
);
expect
(
slider
.
positionProperty
).
to
.
equal
(
'left'
);
expect
(
slider
.
dimensionProperty
).
to
.
equal
(
'width'
);
expect
(
slider
.
dimensionProperty
).
to
.
equal
(
'width'
);
expect
(
slider
.
sliderElem
.
hasClass
(
'vertical'
)).
to
.
be
.
false
;
});
});
it
(
'vertical slider should take the full height and get correct position/dimension properties'
,
function
()
{
it
(
'vertical slider should take the full height and get correct position/dimension properties'
,
function
()
{
...
@@ -297,6 +300,7 @@ describe('rzslider - ', function() {
...
@@ -297,6 +300,7 @@ describe('rzslider - ', function() {
expect
(
element
[
0
].
getBoundingClientRect
().
height
).
to
.
equal
(
1000
);
expect
(
element
[
0
].
getBoundingClientRect
().
height
).
to
.
equal
(
1000
);
expect
(
slider
.
positionProperty
).
to
.
equal
(
'bottom'
);
expect
(
slider
.
positionProperty
).
to
.
equal
(
'bottom'
);
expect
(
slider
.
dimensionProperty
).
to
.
equal
(
'height'
);
expect
(
slider
.
dimensionProperty
).
to
.
equal
(
'height'
);
expect
(
slider
.
sliderElem
.
hasClass
(
'vertical'
)).
to
.
be
.
true
;
});
});
it
(
'should prevent invalid step'
,
function
()
{
it
(
'should prevent invalid step'
,
function
()
{
...
@@ -409,10 +413,17 @@ describe('rzslider - ', function() {
...
@@ -409,10 +413,17 @@ describe('rzslider - ', function() {
createRangeSlider
(
sliderConf
);
createRangeSlider
(
sliderConf
);
});
});
it
(
'should set the correct class to true when draggableRange is true'
,
function
()
{
scope
.
slider
.
options
.
draggableRange
=
true
;
scope
.
$digest
();
expect
(
slider
.
selBar
.
hasClass
(
'rz-draggable'
)).
to
.
be
.
true
;
});
it
(
'should set draggableRange to true when draggableRangeOnly is true'
,
function
()
{
it
(
'should set draggableRange to true when draggableRangeOnly is true'
,
function
()
{
scope
.
slider
.
options
.
draggableRangeOnly
=
true
;
scope
.
slider
.
options
.
draggableRangeOnly
=
true
;
scope
.
$digest
();
scope
.
$digest
();
expect
(
slider
.
options
.
draggableRange
).
to
.
be
.
true
;
expect
(
slider
.
options
.
draggableRange
).
to
.
be
.
true
;
expect
(
slider
.
selBar
.
hasClass
(
'rz-draggable'
)).
to
.
be
.
true
;
});
});
it
(
'should sanitize rzSliderModel and rzSliderHigh between floor and ceil'
,
function
()
{
it
(
'should sanitize rzSliderModel and rzSliderHigh between floor and ceil'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment