Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
723772ab
Commit
723772ab
authored
Oct 22, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote Jasmine tests for slider range to reuse function. More compact and concise.
parent
15909954
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
59 deletions
+43
-59
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
+43
-59
No files found.
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
View file @
723772ab
...
@@ -185,75 +185,59 @@
...
@@ -185,75 +185,59 @@
});
});
describe
(
'checking start and end times'
,
function
()
{
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
()
{
beforeEach
(
function
()
{
loadFixtures
(
'video.html'
);
loadFixtures
(
'video.html'
);
});
});
it
(
'both times are proper'
,
function
()
{
$
.
each
(
miniTestSuite
,
function
(
index
,
test
)
{
$
(
'#example'
).
find
(
'.video'
)
itFabrique
(
test
.
itDescription
,
test
.
data
,
test
.
expectData
);
.
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
);
});
});
it
(
'start time is less than 0'
,
function
()
{
return
;
$
(
'#example'
).
find
(
'.video'
)
.
data
({
'start'
:
-
12
,
'end'
:
24
});
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
0
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
it
(
'start time is greater than end time'
,
function
()
{
function
itFabrique
(
itDescription
,
data
,
expectData
)
{
$
(
'#example'
).
find
(
'.video'
)
it
(
itDescription
,
function
()
{
.
data
({
$
(
'#example'
).
find
(
'.video'
)
'start'
:
42
,
.
data
({
'end'
:
24
'start'
:
data
.
start
,
});
'end'
:
data
.
end
});
state
=
new
Video
(
'#example'
);
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
42
);
expect
(
state
.
config
.
start
).
toBe
(
expectData
.
start
);
expect
(
state
.
config
.
end
).
toBe
(
null
);
expect
(
state
.
config
.
end
).
toBe
(
expectData
.
end
);
});
});
}
});
});
describe
(
'multiple YT on page'
,
function
()
{
describe
(
'multiple YT on page'
,
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