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
fa62f48e
Commit
fa62f48e
authored
Jul 02, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Jasmine test failures
parent
e7088d50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
cms/static/coffee/spec/views/textbook_spec.coffee
+19
-5
cms/templates/js/upload-dialog.underscore
+1
-1
No files found.
cms/static/coffee/spec/views/textbook_spec.coffee
View file @
fa62f48e
...
...
@@ -25,6 +25,17 @@ describe "CMS.Views.ShowTextbook", ->
@
promptSpies
=
spyOnConstructor
(
CMS
.
Views
.
Prompt
,
"Warning"
,
[
"show"
,
"hide"
])
@
promptSpies
.
show
.
andReturn
(
@
promptSpies
)
window
.
section
=
new
CMS
.
Models
.
Section
({
id
:
"5"
,
name
:
"Course Name"
,
url_name
:
"course_name"
,
org
:
"course_org"
,
num
:
"course_num"
,
revision
:
"course_rev"
});
afterEach
->
delete
window
.
section
describe
"Basic"
,
->
it
"should render properly"
,
->
...
...
@@ -334,7 +345,8 @@ describe "CMS.Views.UploadDialog", ->
it
"should render without a file selected"
,
->
@
view
.
render
()
expect
(
@
view
.
$el
).
toContain
(
"input[type=file]"
)
expect
(
@
view
.
$
(
".action-upload"
)).
toBeDisabled
()
# expect(@view.$(".action-upload")).toBeDisabled()
expect
(
@
view
.
$
(
".action-upload"
)).
toHaveClass
(
"disabled"
)
it
"should render with a PDF selected"
,
->
file
=
{
name
:
"fake.pdf"
,
"type"
:
"application/pdf"
}
...
...
@@ -342,8 +354,9 @@ describe "CMS.Views.UploadDialog", ->
@
model
.
set
(
"selectedFile"
,
file
)
@
view
.
render
()
expect
(
@
view
.
$el
).
toContain
(
"input[type=file]"
)
expect
(
@
view
.
$el
).
not
.
toContain
(
"p.error"
)
expect
(
@
view
.
$
(
".action-upload"
)).
not
.
toBeDisabled
()
expect
(
@
view
.
$el
).
not
.
toContain
(
"#upload_error"
)
# expect(@view.$(".action-upload")).not.toBeDisabled()
expect
(
@
view
.
$
(
".action-upload"
)).
not
.
toHaveClass
(
"disabled"
)
it
"should render an error with an invalid file type selected"
,
->
file
=
{
name
:
"fake.png"
,
"type"
:
"image/png"
}
...
...
@@ -351,8 +364,9 @@ describe "CMS.Views.UploadDialog", ->
@
model
.
set
(
"selectedFile"
,
file
)
@
view
.
render
()
expect
(
@
view
.
$el
).
toContain
(
"input[type=file]"
)
expect
(
@
view
.
$el
).
toContain
(
"p.error"
)
expect
(
@
view
.
$
(
".action-upload"
)).
toBeDisabled
()
expect
(
@
view
.
$el
).
toContain
(
"#upload_error"
)
# expect(@view.$(".action-upload")).toBeDisabled()
expect
(
@
view
.
$
(
".action-upload"
)).
toHaveClass
(
"disabled"
)
it
"adds body class on show()"
,
->
...
...
cms/templates/js/upload-dialog.underscore
View file @
fa62f48e
...
...
@@ -42,7 +42,7 @@
<h3 class="sr"><%= gettext('Form Actions') %></h3>
<ul>
<li class="action-item">
<a href="#" class="button action-primary action-upload <% if (!selectedFile) { %>disabled<% } %>"><%= gettext('Upload') %></a>
<a href="#" class="button action-primary action-upload <% if (!selectedFile
|| error
) { %>disabled<% } %>"><%= gettext('Upload') %></a>
</li>
<li class="action-item">
<a href="#" class="button action-secondary action-cancel"><%= gettext('Cancel') %></a>
...
...
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