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

32 lines
1 KiB
Text
Raw Normal View History

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