If not certificates remove the container element from the DOM
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user