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
9becd565
Commit
9becd565
authored
May 10, 2016
by
AlasdairSwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If not certificates remove the container element from the DOM
parent
db05aeb7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
common/test/acceptance/pages/lms/programs.py
+1
-1
lms/static/js/learner_dashboard/views/certificate_view.js
+6
-0
lms/static/js/spec/learner_dashboard/certificate_view_spec.js
+1
-3
No files found.
common/test/acceptance/pages/lms/programs.py
View file @
9becd565
...
@@ -19,4 +19,4 @@ class ProgramListingPage(PageObject):
...
@@ -19,4 +19,4 @@ class ProgramListingPage(PageObject):
@property
@property
def
is_sidebar_present
(
self
):
def
is_sidebar_present
(
self
):
"""Check whether sidebar is present."""
"""Check whether sidebar is present."""
return
self
.
q
(
css
=
'.sidebar'
)
.
present
and
self
.
q
(
css
=
'.certificates-list'
)
.
present
return
self
.
q
(
css
=
'.sidebar'
)
.
present
lms/static/js/learner_dashboard/views/certificate_view.js
View file @
9becd565
...
@@ -25,6 +25,12 @@
...
@@ -25,6 +25,12 @@
if
(
certificatesData
.
length
)
{
if
(
certificatesData
.
length
)
{
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
}
else
{
/**
* If not rendering remove el because
* styles are applied to it
*/
this
.
remove
();
}
}
}
}
});
});
...
...
lms/static/js/spec/learner_dashboard/certificate_view_spec.js
View file @
9becd565
...
@@ -50,15 +50,13 @@ define([
...
@@ -50,15 +50,13 @@ define([
});
});
it
(
'should display no certificate box if certificates list is empty'
,
function
()
{
it
(
'should display no certificate box if certificates list is empty'
,
function
()
{
var
$certificate
;
view
.
remove
();
view
.
remove
();
setFixtures
(
'<div class="certificates-list"></div>'
);
setFixtures
(
'<div class="certificates-list"></div>'
);
view
=
new
CertificateView
({
view
=
new
CertificateView
({
context
:
{
certificatesData
:
[]}
context
:
{
certificatesData
:
[]}
});
});
view
.
render
();
view
.
render
();
$certificate
=
view
.
$el
.
find
(
'.certificate-link'
);
expect
(
view
.
$
(
'.certificates-list'
).
length
).
toBe
(
0
);
expect
(
$certificate
.
length
).
toBe
(
0
);
});
});
});
});
}
}
...
...
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