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
708736c4
Commit
708736c4
authored
Jan 10, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit tests around the save method (xml and markdown).
parent
993d59b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
common/lib/xmodule/xmodule/js/fixtures/problem-with-markdown.html
+7
-0
common/lib/xmodule/xmodule/js/fixtures/problem-without-markdown.html
+6
-0
common/lib/xmodule/xmodule/js/spec/problem/edit_spec.coffee
+20
-0
No files found.
common/lib/xmodule/xmodule/js/fixtures/problem-with-markdown.html
0 → 100644
View file @
708736c4
<section
class=
"problem-editor editor"
>
<div
class=
"row"
>
<textarea
class=
"markdown-box"
>
markdown
</textarea>
<textarea
class=
"xml-box"
rows=
"8"
cols=
"40"
>
xml
</textarea>
</div>
</section>
\ No newline at end of file
common/lib/xmodule/xmodule/js/fixtures/problem-without-markdown.html
0 → 100644
View file @
708736c4
<section
class=
"problem-editor editor"
>
<div
class=
"row"
>
<textarea
class=
"xml-box"
rows=
"8"
cols=
"40"
>
xml only
</textarea>
</div>
</section>
\ No newline at end of file
common/lib/xmodule/xmodule/js/spec/problem/edit_spec.coffee
View file @
708736c4
describe
'MarkdownEditingDescriptor'
,
->
describe
'save stores the correct data'
,
->
it
'saves markdown from markdown editor'
,
->
loadFixtures
'problem-with-markdown.html'
@
descriptor
=
new
MarkdownEditingDescriptor
(
$
(
'.problem-editor'
))
saveResult
=
@
descriptor
.
save
()
expect
(
saveResult
.
metadata
.
markdown
).
toEqual
(
'markdown'
)
expect
(
saveResult
.
data
).
toEqual
(
'<problem>
\n
<p>markdown</p>
\n
</problem>'
)
it
'clears markdown when xml editor is selected'
,
->
loadFixtures
'problem-with-markdown.html'
@
descriptor
=
new
MarkdownEditingDescriptor
(
$
(
'.problem-editor'
))
@
descriptor
.
createXMLEditor
(
'replace with markdown'
)
saveResult
=
@
descriptor
.
save
()
expect
(
saveResult
.
metadata
.
markdown
).
toEqual
(
null
)
expect
(
saveResult
.
data
).
toEqual
(
'replace with markdown'
)
it
'saves xml from the xml editor'
,
->
loadFixtures
'problem-without-markdown.html'
@
descriptor
=
new
MarkdownEditingDescriptor
(
$
(
'.problem-editor'
))
saveResult
=
@
descriptor
.
save
()
expect
(
saveResult
.
metadata
.
markdown
).
toEqual
(
null
)
expect
(
saveResult
.
data
).
toEqual
(
'xml only'
)
describe
'insertMultipleChoice'
,
->
it
'inserts the template if selection is empty'
,
->
...
...
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