Add `categories-list` css class to body for customization purposes
This commit is contained in:
parent
514a45b0c1
commit
03eb4752d1
|
@ -1,3 +1,11 @@
|
|||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
||||
|
||||
export default Discourse.View.extend(UrlRefresh, Discourse.ScrollTop);
|
||||
export default Discourse.View.extend(UrlRefresh, Discourse.ScrollTop, {
|
||||
_addBodyClass: function() {
|
||||
$('body').addClass('categories-list');
|
||||
}.on('didInsertElement'),
|
||||
|
||||
_removeBodyClass: function() {
|
||||
$('body').removeClass('categories-list');
|
||||
}.on('willDestroyElement')
|
||||
});
|
||||
|
|
|
@ -11,15 +11,20 @@ test("Visit Discovery Pages", function() {
|
|||
andThen(function() {
|
||||
ok(exists(".topic-list"), "The list of topics was rendered");
|
||||
ok(exists('.topic-list .topic-list-item'), "has topics");
|
||||
ok($('body.category-1').length, "has a custom css class for the category id on the body");
|
||||
});
|
||||
|
||||
visit("/categories");
|
||||
andThen(function() {
|
||||
ok($('body.category-1').length === 0, "removes the custom category class");
|
||||
|
||||
ok(exists('.category'), "has a list of categories");
|
||||
ok($('body.categories-list').length, "has a custom class to indicate categories");
|
||||
});
|
||||
|
||||
visit("/top");
|
||||
andThen(function() {
|
||||
ok($('body.categories-list').length === 0, "removes the `categories-list` class");
|
||||
ok(exists('.topic-list .topic-list-item'), "has topics");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue