Commit 599070e5 by AlasdairSwan

Merge pull request #12412 from edx/alasdair/program-listing-certificate-fix

If not certificates remove the container element from the DOM
parents 64041503 9becd565
......@@ -19,4 +19,4 @@ class ProgramListingPage(PageObject):
@property
def is_sidebar_present(self):
"""Check whether sidebar is present."""
return self.q(css='.sidebar').present and self.q(css='.certificates-list').present
return self.q(css='.sidebar').present
......@@ -25,6 +25,12 @@
if (certificatesData.length) {
this.$el.html(this.tpl(this.context));
} else {
/**
* If not rendering remove el because
* styles are applied to it
*/
this.remove();
}
}
});
......
......@@ -50,15 +50,13 @@ define([
});
it('should display no certificate box if certificates list is empty', function() {
var $certificate;
view.remove();
setFixtures('<div class="certificates-list"></div>');
view = new CertificateView({
context: {certificatesData: []}
});
view.render();
$certificate = view.$el.find('.certificate-link');
expect($certificate.length).toBe(0);
expect(view.$('.certificates-list').length).toBe(0);
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment