Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
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
OpenEdx
xblock-drag-and-drop-v2
Commits
0b8af86c
Commit
0b8af86c
authored
Mar 23, 2015
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29 from edx-solutions/hotfix-custom-bg-image
Add tests for background image
parents
70cd532e
8e3f7f6e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
drag_and_drop_v2/public/js/view.js
+3
-1
tests/integration/data/test_html_data.json
+2
-1
tests/integration/test_custom_data_render.py
+5
-0
tests/integration/test_render.py
+5
-0
No files found.
drag_and_drop_v2/public/js/view.js
View file @
0b8af86c
...
...
@@ -88,7 +88,9 @@
h
(
'div.close.icon-remove-sign.fa-times-circle'
),
h
(
'p.popup-content'
,
{
innerHTML
:
ctx
.
popup_html
})
]),
h
(
'div.target-img'
,
{
style
:
{
backgroundImage
:
'url('
+
ctx
.
target_img_src
+
')'
}},
h
(
'div.target-img'
,
{
style
:
{
backgroundImage
:
ctx
.
target_img_src
?
'url('
+
ctx
.
target_img_src
+
')'
:
undefined
}},
renderCollection
(
zoneTemplate
,
ctx
.
zones
,
ctx
))
]),
h
(
'div.clear'
)
...
...
tests/integration/data/test_html_data.json
View file @
0b8af86c
...
...
@@ -74,5 +74,6 @@
"feedback"
:
{
"start"
:
"Intro <i>Feed</i>"
,
"finish"
:
"Final <b>Feed</b>"
}
},
"targetImg"
:
"https://www.edx.org/sites/default/files/theme/edx-logo-header.png"
}
tests/integration/test_custom_data_render.py
View file @
0b8af86c
...
...
@@ -24,3 +24,8 @@ class TestCustomDataDragAndDropRendering(BaseIntegrationTest):
self
.
assertIn
(
'<i>B</i>'
,
self
.
get_element_html
(
items
[
1
]))
self
.
assertIn
(
'<input class="input" type="text">'
,
self
.
get_element_html
(
items
[
1
]))
self
.
assertIn
(
'<span style="color:red">X</span>'
,
self
.
get_element_html
(
items
[
2
]))
def
test_background_image
(
self
):
bg_image
=
self
.
browser
.
execute_script
(
'return jQuery(".target-img").css("background-image")'
)
custom_image_url
=
'https://www.edx.org/sites/default/files/theme/edx-logo-header.png'
self
.
assertEqual
(
bg_image
,
'url("{}")'
.
format
(
custom_image_url
))
tests/integration/test_render.py
View file @
0b8af86c
...
...
@@ -60,3 +60,8 @@ class TestDragAndDropRender(BaseIntegrationTest):
feedback_message
=
self
.
_get_feedback_message
()
self
.
assertEqual
(
feedback_message
.
text
,
"Intro Feed"
)
def
test_background_image
(
self
):
bg_image
=
self
.
browser
.
execute_script
(
'return jQuery(".target-img").css("background-image")'
)
image_path
=
'/resource/drag-and-drop-v2/public/img/triangle.png'
self
.
assertEqual
(
bg_image
,
'url("{0}{1}")'
.
format
(
self
.
live_server_url
,
image_path
))
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