Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
9a813f2e
Commit
9a813f2e
authored
Oct 09, 2017
by
judell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address review comments
parent
27fe08f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
media-embedder-test.js
src/sidebar/test/media-embedder-test.js
+9
-5
No files found.
src/sidebar/test/media-embedder-test.js
View file @
9a813f2e
...
@@ -92,18 +92,22 @@ describe('media-embedder', function () {
...
@@ -92,18 +92,22 @@ describe('media-embedder', function () {
it
(
'replaces internet archive links with iframes'
,
function
()
{
it
(
'replaces internet archive links with iframes'
,
function
()
{
var
urls
=
[
var
urls
=
[
'https://archive.org/details/
WHDH_20151121_043400_The_Tonight_Show_Starring_Jimmy_Fallon
/start/360/end/420.3'
,
'https://archive.org/details/
PATH
/start/360/end/420.3'
,
'https://archive.org/embed/
WHDH_20151121_043400_The_Tonight_Show_Starring_Jimmy_Fallon
?start=360&end=420.3'
,
'https://archive.org/embed/
PATH
?start=360&end=420.3'
,
];
];
urls
.
forEach
(
function
(
url
)
{
urls
.
forEach
(
function
(
url
)
{
var
element
=
domElement
(
'<a href="'
+
url
+
'">'
+
url
+
'</a>'
);
var
element
=
domElement
(
'<a href="'
+
url
+
'">'
+
url
+
'</a>'
);
mediaEmbedder
.
replaceLinksWithEmbeds
(
element
);
mediaEmbedder
.
replaceLinksWithEmbeds
(
element
);
assert
.
equal
(
element
.
childElementCount
,
1
);
assert
.
equal
(
element
.
children
[
0
].
tagName
,
'IFRAME'
);
assert
.
equal
(
element
.
children
[
0
].
tagName
,
'IFRAME'
);
assert
.
equal
(
element
.
children
[
0
].
src
,
'https://archive.org/embed/WHDH_20151121_043400_The_Tonight_Show_Starring_Jimmy_Fallon?start=360&end=420.3'
);
// For both url flavors the expected result is the same.
// details flavor: we match, transform, and iframe
// embed flavor: we just match and iframe
var
actual
=
element
.
children
[
0
].
src
;
var
expected
=
'https://archive.org/embed/PATH?start=360&end=420.3'
;
assert
.
equal
(
actual
,
expected
);
});
});
});
});
...
...
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