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
4b738d4c
Commit
4b738d4c
authored
Aug 12, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored into helper method
parent
9769f364
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
cms/static/coffee/spec/views/metadata_edit_spec.coffee
+10
-16
No files found.
cms/static/coffee/spec/views/metadata_edit_spec.coffee
View file @
4b738d4c
verifyInputType
=
(
input
,
expectedType
)
->
# Some browsers (e.g. FireFox) do not support the "number"
# input type. We can accept a "text" input instead
# and still get acceptable behavior in the UI.
if
expectedType
==
'number'
and
input
.
type
!=
'number'
expectedType
=
'text'
expect
(
input
.
type
).
toBe
(
expectedType
)
describe
"Test Metadata Editor"
,
->
editorTemplate
=
readFixtures
(
'metadata-editor.underscore'
)
numberEntryTemplate
=
readFixtures
(
'metadata-number-entry.underscore'
)
...
...
@@ -113,14 +121,7 @@ describe "Test Metadata Editor", ->
verifyEntry
=
(
index
,
display_name
,
type
)
->
expect
(
childModels
[
index
].
get
(
'display_name'
)).
toBe
(
display_name
)
# Some browsers (e.g. FireFox) do not support the "number"
# input type. We can accept a "text" input instead
# and still get acceptable behavior in the UI.
if
type
==
'number'
and
childViews
[
index
].
type
!=
'number'
type
=
'text'
expect
(
childViews
[
index
].
type
).
toBe
(
type
)
verifyInputType
(
childViews
[
index
],
type
)
verifyEntry
(
0
,
'Display Name'
,
'text'
)
verifyEntry
(
1
,
'Inputs'
,
'number'
)
...
...
@@ -171,14 +172,7 @@ describe "Test Metadata Editor", ->
assertInputType
=
(
view
,
expectedType
)
->
input
=
view
.
$el
.
find
(
'.setting-input'
)
expect
(
input
.
length
).
toEqual
(
1
)
# Some browsers (e.g. FireFox) do not support the "number"
# input type. We can accept a "text" input instead
# and still get acceptable behavior in the UI.
if
expectedType
==
'number'
and
input
[
0
].
type
!=
'number'
expectedType
=
'text'
expect
(
input
[
0
].
type
).
toEqual
(
expectedType
)
verifyInputType
(
input
[
0
],
expectedType
)
assertValueInView
=
(
view
,
expectedValue
)
->
expect
(
view
.
getValueFromEditor
()).
toEqual
(
expectedValue
)
...
...
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