Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions cms/djangoapps/contentstore/views/tests/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -4756,3 +4756,20 @@ def test_xblock_edit_view_contains_resources(self):

self.assertGreater(len(resource_links), 0, f"No CSS resources found in HTML. Found: {resource_links}") # noqa: PT009 # pylint: disable=line-too-long
self.assertGreater(len(script_sources), 0, f"No JS resources found in HTML. Found: {script_sources}") # noqa: PT009 # pylint: disable=line-too-long

def test_xblock_edit_view_contains_page_notification(self):
"""
The page-notification element is required for XBlock runtime error
notifications (e.g. ORA validation errors) to be visible to the user.
"""
url = reverse_usage_url("xblock_edit_handler", self.video.location)
resp = self.client.get(url)
self.assertEqual(resp.status_code, 200) # noqa: PT009

html_content = resp.content.decode(resp.charset)
soup = BeautifulSoup(html_content, "html.parser")
self.assertIsNotNone( # noqa: PT009
soup.find(id="page-notification"),
"container_editor.html must include a #page-notification element "
"so that XBlock runtime error notifications are rendered.",
)
1 change: 1 addition & 0 deletions cms/templates/container_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
</head>

<body class="${static.dir_rtl()} <%block name='bodyclass'></%block> lang_${LANGUAGE_CODE} view-container">
<div id="page-notification"></div>
<%static:js group='base_vendor' />
<%static:webpack entry='commons' />

Expand Down
Loading