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
070d24cf
Commit
070d24cf
authored
May 14, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jasmine doesn't like asserting on the <body> element :(
parent
10ec6046
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
cms/static/coffee/spec/views/feedback_spec.coffee
+9
-1
cms/static/js/views/feedback.js
+1
-0
No files found.
cms/static/coffee/spec/views/feedback_spec.coffee
View file @
070d24cf
...
...
@@ -40,5 +40,13 @@ describe "CMS.Views.SystemFeedback", ->
expect
(
view
.
$
(
'.wrapper'
)).
not
.
toHaveClass
(
"is-shown"
)
expect
(
view
.
$
(
'.wrapper'
)).
toHaveClass
(
"is-hiding"
)
# for some reason, expect($("body")) blows up the test runner, so this test
# just exercises the Prompt rather than asserting on anything. Best I can
# do for now. :(
it
"prompt view changes class on body"
,
->
# expect($("body")).not.toHaveClass("prompt-is-shown")
view
=
new
CMS
.
Views
.
Prompt
({
model
:
@
model
})
# expect($("body")).toHaveClass("prompt-is-shown")
@
model
.
hide
()
# expect($("body")).not.toHaveClass("prompt-is-shown")
cms/static/js/views/feedback.js
View file @
070d24cf
...
...
@@ -55,6 +55,7 @@ CMS.Views.Notification = CMS.Views.SystemFeedback.extend({
CMS
.
Views
.
Prompt
=
CMS
.
Views
.
SystemFeedback
.
extend
({
type
:
"prompt"
,
render
:
function
()
{
if
(
!
window
.
$body
)
{
window
.
$body
=
$
(
document
.
body
);
}
if
(
this
.
model
.
get
(
'shown'
))
{
$body
.
addClass
(
'prompt-is-shown'
);
}
else
{
...
...
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