Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
723772ab
Commit
723772ab
authored
11 years ago
by
Valera Rozuvan
Browse files
Options
Downloads
Patches
Plain Diff
Rewrote Jasmine tests for slider range to reuse function. More compact and concise.
parent
15909954
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
+43
-59
43 additions, 59 deletions
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
with
43 additions
and
59 deletions
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
+
43
−
59
View file @
723772ab
...
...
@@ -185,75 +185,59 @@
});
describe
(
'
checking start and end times
'
,
function
()
{
var
miniTestSuite
=
[
{
itDescription
:
'
both times are proper
'
,
data
:
{
start
:
12
,
end
:
24
},
expectData
:
{
start
:
12
,
end
:
24
}
},
{
itDescription
:
'
start time is invalid
'
,
data
:
{
start
:
''
,
end
:
24
},
expectData
:
{
start
:
0
,
end
:
24
}
},
{
itDescription
:
'
end time is invalid
'
,
data
:
{
start
:
12
,
end
:
''
},
expectData
:
{
start
:
12
,
end
:
null
}
},
{
itDescription
:
'
start time is less than 0
'
,
data
:
{
start
:
-
12
,
end
:
24
},
expectData
:
{
start
:
0
,
end
:
24
}
},
{
itDescription
:
'
start time is greater than end time
'
,
data
:
{
start
:
42
,
end
:
24
},
expectData
:
{
start
:
42
,
end
:
null
}
},
];
beforeEach
(
function
()
{
loadFixtures
(
'
video.html
'
);
});
it
(
'
both times are proper
'
,
function
()
{
$
(
'
#example
'
).
find
(
'
.video
'
)
.
data
({
'
start
'
:
12
,
'
end
'
:
24
});
state
=
new
Video
(
'
#example
'
);
expect
(
state
.
config
.
start
).
toBe
(
12
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
it
(
'
start time is invalid
'
,
function
()
{
$
(
'
#example
'
).
find
(
'
.video
'
)
.
data
({
'
start
'
:
''
,
'
end
'
:
24
});
state
=
new
Video
(
'
#example
'
);
expect
(
state
.
config
.
start
).
toBe
(
0
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
it
(
'
end time is invalid
'
,
function
()
{
$
(
'
#example
'
).
find
(
'
.video
'
)
.
data
({
'
start
'
:
12
,
'
end
'
:
''
});
state
=
new
Video
(
'
#example
'
);
expect
(
state
.
config
.
start
).
toBe
(
12
);
expect
(
state
.
config
.
end
).
toBe
(
null
);
$
.
each
(
miniTestSuite
,
function
(
index
,
test
)
{
itFabrique
(
test
.
itDescription
,
test
.
data
,
test
.
expectData
);
});
it
(
'
start time is less than 0
'
,
function
()
{
$
(
'
#example
'
).
find
(
'
.video
'
)
.
data
({
'
start
'
:
-
12
,
'
end
'
:
24
});
state
=
new
Video
(
'
#example
'
);
expect
(
state
.
config
.
start
).
toBe
(
0
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
return
;
it
(
'
start time is greater than end time
'
,
function
()
{
$
(
'
#example
'
).
find
(
'
.video
'
)
.
data
({
'
start
'
:
42
,
'
end
'
:
24
});
function
itFabrique
(
itDescription
,
data
,
expectData
)
{
it
(
itDescription
,
function
()
{
$
(
'
#example
'
).
find
(
'
.video
'
)
.
data
({
'
start
'
:
data
.
start
,
'
end
'
:
data
.
end
});
state
=
new
Video
(
'
#example
'
);
state
=
new
Video
(
'
#example
'
);
expect
(
state
.
config
.
start
).
toBe
(
42
);
expect
(
state
.
config
.
end
).
toBe
(
null
);
});
expect
(
state
.
config
.
start
).
toBe
(
expectData
.
start
);
expect
(
state
.
config
.
end
).
toBe
(
expectData
.
end
);
});
}
});
describe
(
'
multiple YT on page
'
,
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment