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
0e3e90f8
Commit
0e3e90f8
authored
May 11, 2017
by
Attiya Ishaque
Committed by
GitHub
May 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15057 from edx/ai/EDUCATOR-283
EDUCATOR-283 Old mathjax not load in preview box.
parents
424d3b40
9188dbdb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
common/static/common/js/discussion/views/new_post_view.js
+1
-1
common/test/acceptance/pages/lms/discussion.py
+2
-2
common/test/acceptance/tests/discussion/test_discussion.py
+22
-1
No files found.
common/static/common/js/discussion/views/new_post_view.js
View file @
0e3e90f8
...
...
@@ -202,7 +202,7 @@
var
$general
;
this
.
$
(
'.forum-new-post-form'
)[
0
].
reset
();
DiscussionUtil
.
clearFormErrors
(
this
.
$
(
'.post-errors'
));
this
.
$
(
'.wmd-preview
p
'
).
html
(
''
);
this
.
$
(
'.wmd-preview'
).
html
(
''
);
if
(
this
.
isTabMode
())
{
$general
=
this
.
$
(
'.post-topic option:contains(General)'
);
this
.
topicView
.
setTopic
(
$general
||
this
.
$
(
'button.topic-title'
).
first
());
...
...
common/test/acceptance/pages/lms/discussion.py
View file @
0e3e90f8
...
...
@@ -718,12 +718,12 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
"""
self
.
q
(
css
=
".wmd-input"
)
.
fill
(
new_body
)
def
get_new_post_preview_value
(
self
):
def
get_new_post_preview_value
(
self
,
selector
=
".wmd-preview > *"
):
"""
Get the rendered preview of the contents of the Discussions new post editor
Waits for content to appear, as the preview is triggered on debounced/delayed onchange
"""
self
.
wait_for_element_visibility
(
".wmd-preview > *"
,
"WMD preview pane has contents"
,
timeout
=
10
)
self
.
wait_for_element_visibility
(
selector
,
"WMD preview pane has contents"
,
timeout
=
10
)
return
self
.
q
(
css
=
".wmd-preview"
)
.
html
[
0
]
def
get_new_post_preview_text
(
self
):
...
...
common/test/acceptance/tests/discussion/test_discussion.py
View file @
0e3e90f8
...
...
@@ -11,7 +11,7 @@ from pytz import UTC
from
flaky
import
flaky
from
common.test.acceptance.tests.discussion.helpers
import
BaseDiscussionTestCase
from
common.test.acceptance.tests.helpers
import
UniqueCourseTest
from
common.test.acceptance.tests.helpers
import
UniqueCourseTest
,
get_modal_alert
from
common.test.acceptance.pages.lms.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.lms.courseware
import
CoursewarePage
from
common.test.acceptance.pages.lms.discussion
import
(
...
...
@@ -997,6 +997,27 @@ class DiscussionEditorPreviewTest(UniqueCourseTest):
self
.
assertEqual
(
self
.
page
.
get_new_post_preview_text
(),
'Text line 1
\n
Text line 2'
)
def
test_mathjax_not_rendered_after_post_cancel
(
self
):
"""
Tests that mathjax is not rendered when we cancel the post
When user types the mathjax expression into discussion editor, it will appear in te preview
box, and when user cancel it and again click the "Add new post" button, mathjax will not
appear in the preview box
"""
self
.
page
.
set_new_post_editor_value
(
'
\\
begin{equation}'
'
\\
tau_g(
\
omega) = -
\\
frac{d}{d
\
omega}
\
phi(
\
omega)
\
hspace{2em} (1) '
'
\\
end{equation}'
)
self
.
assertIsNotNone
(
self
.
page
.
get_new_post_preview_text
())
self
.
page
.
click_element
(
".cancel"
)
alert
=
get_modal_alert
(
self
.
browser
)
alert
.
accept
()
self
.
assertIsNotNone
(
self
.
page
.
new_post_button
)
self
.
page
.
click_new_post_button
()
self
.
assertEqual
(
self
.
page
.
get_new_post_preview_value
(
'.wmd-preview'
),
""
)
@attr
(
shard
=
2
)
class
InlineDiscussionTest
(
UniqueCourseTest
,
DiscussionResponsePaginationTestMixin
):
...
...
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