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
6c26715a
Commit
6c26715a
authored
Apr 26, 2016
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make hashes unique so that they do not conflict with hashes from module_edit_spec.coffee.
parent
8f79d801
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
cms/static/js/spec/views/xblock_spec.js
+9
-5
No files found.
cms/static/js/spec/views/xblock_spec.js
View file @
6c26715a
...
...
@@ -62,8 +62,8 @@ define(["jquery", "URI", "common/js/spec_helpers/ajax_helpers", "common/js/compo
mockCssUrl
=
"mock.css"
,
headHtml
;
postXBlockRequest
(
requests
,
[
[
"hash1"
,
{
mimetype
:
"text/css"
,
kind
:
"text"
,
data
:
mockCssText
}],
[
"hash2"
,
{
mimetype
:
"text/css"
,
kind
:
"url"
,
data
:
mockCssUrl
}]
[
"
xblock_spec_
hash1"
,
{
mimetype
:
"text/css"
,
kind
:
"text"
,
data
:
mockCssText
}],
[
"
xblock_spec_
hash2"
,
{
mimetype
:
"text/css"
,
kind
:
"url"
,
data
:
mockCssUrl
}]
]);
headHtml
=
$
(
'head'
).
html
();
expect
(
headHtml
).
toContain
(
mockCssText
);
...
...
@@ -73,7 +73,9 @@ define(["jquery", "URI", "common/js/spec_helpers/ajax_helpers", "common/js/compo
it
(
'can render an xblock with required JavaScript'
,
function
()
{
var
requests
=
AjaxHelpers
.
requests
(
this
);
postXBlockRequest
(
requests
,
[
[
"hash3"
,
{
mimetype
:
"application/javascript"
,
kind
:
"text"
,
data
:
"window.test = 100;"
}]
[
"xblock_spec_hash3"
,
{
mimetype
:
"application/javascript"
,
kind
:
"text"
,
data
:
"window.test = 100;"
}]
]);
expect
(
window
.
test
).
toBe
(
100
);
});
...
...
@@ -82,7 +84,7 @@ define(["jquery", "URI", "common/js/spec_helpers/ajax_helpers", "common/js/compo
var
requests
=
AjaxHelpers
.
requests
(
this
),
mockHeadTag
=
"<title>Test Title</title>"
;
postXBlockRequest
(
requests
,
[
[
"hash4"
,
{
mimetype
:
"text/html"
,
placement
:
"head"
,
data
:
mockHeadTag
}]
[
"
xblock_spec_
hash4"
,
{
mimetype
:
"text/html"
,
placement
:
"head"
,
data
:
mockHeadTag
}]
]);
expect
(
$
(
'head'
).
html
()).
toContain
(
mockHeadTag
);
});
...
...
@@ -93,7 +95,9 @@ define(["jquery", "URI", "common/js/spec_helpers/ajax_helpers", "common/js/compo
promise
;
spyOn
(
ViewUtils
,
'loadJavaScript'
).
and
.
returnValue
(
$
.
Deferred
().
reject
().
promise
());
promise
=
postXBlockRequest
(
requests
,
[
[
"hash5"
,
{
mimetype
:
"application/javascript"
,
kind
:
"url"
,
data
:
missingJavaScriptUrl
}]
[
"xblock_spec_hash5"
,
{
mimetype
:
"application/javascript"
,
kind
:
"url"
,
data
:
missingJavaScriptUrl
}]
]);
expect
(
promise
.
isRejected
()).
toBe
(
true
);
});
...
...
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