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

33 lines
1.1 KiB
Plaintext
Raw Normal View History

import { acceptance } from "helpers/qunit-helpers";
acceptance("Topic Discovery");
test("Visit Discovery Pages", () => {
2014-07-31 01:27:14 +08:00
visit("/");
andThen(() => {
ok($('body.navigation-topics').length, "has the default navigation");
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-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(() => {
2016-11-11 05:20:31 +08:00
ok($('body.navigation-categories').length, "has the body class");
2015-01-27 06:49:15 +08:00
ok($('body.category-bug').length === 0, "removes the custom category class");
2016-08-25 04:53:43 +08:00
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(() => {
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
});
});