discourse/test/javascripts/integration/topic-discovery-test.js.es6

31 lines
1002 B
Plaintext
Raw Normal View History

2014-07-31 01:27:14 +08:00
integration("Topic Discovery");
2014-07-31 01:27:14 +08:00
test("Visit Discovery Pages", function() {
visit("/");
andThen(function() {
ok(exists(".topic-list"), "The list of topics was rendered");
ok(exists('.topic-list .topic-list-item'), "has topics");
});
visit("/c/bug");
2014-07-31 01:27:14 +08:00
andThen(function() {
ok(exists(".topic-list"), "The list of topics was rendered");
ok(exists('.topic-list .topic-list-item'), "has topics");
2015-01-28 06:44:47 +08:00
ok($('body.category-bug').length, "has a custom css class for the category id on the body");
});
2014-07-31 01:27:14 +08:00
visit("/categories");
andThen(function() {
2015-01-27 06:49:15 +08:00
ok($('body.category-bug').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");
});
2014-08-01 06:07:04 +08:00
visit("/top");
andThen(function() {
ok($('body.categories-list').length === 0, "removes the `categories-list` class");
ok(exists('.topic-list .topic-list-item'), "has topics");
2014-08-01 06:07:04 +08:00
});
});