2015-04-07 02:14:00 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Topic Discovery");
|
2013-06-14 03:08:42 +08:00
|
|
|
|
2015-03-19 19:22:56 +08:00
|
|
|
test("Visit Discovery Pages", () => {
|
2014-07-31 01:27:14 +08:00
|
|
|
visit("/");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2016-11-11 02:33:31 +08:00
|
|
|
ok($('body.navigation-topics').length, "has the default navigation");
|
2014-07-30 05:38:36 +08:00
|
|
|
ok(exists(".topic-list"), "The list of topics was rendered");
|
|
|
|
ok(exists('.topic-list .topic-list-item'), "has topics");
|
2013-06-14 03:08:42 +08:00
|
|
|
});
|
2013-07-05 04:19:59 +08:00
|
|
|
|
2014-10-17 00:15:31 +08:00
|
|
|
visit("/c/bug");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-07-30 05:38:36 +08:00
|
|
|
ok(exists(".topic-list"), "The list of topics was rendered");
|
|
|
|
ok(exists('.topic-list .topic-list-item'), "has topics");
|
2017-03-09 00:31:30 +08:00
|
|
|
ok(!exists('.category-list'), "doesn't render subcategories");
|
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");
|
2013-07-05 04:19:59 +08:00
|
|
|
});
|
2013-06-21 03:02:02 +08:00
|
|
|
|
2014-07-31 01:27:14 +08:00
|
|
|
visit("/categories");
|
2015-03-19 19:22:56 +08:00
|
|
|
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");
|
2015-01-22 03:34:01 +08:00
|
|
|
ok($('body.categories-list').length, "has a custom class to indicate categories");
|
2013-06-21 03:02:02 +08:00
|
|
|
});
|
2014-08-01 06:07:04 +08:00
|
|
|
|
|
|
|
visit("/top");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2015-01-22 03:34:01 +08:00
|
|
|
ok($('body.categories-list').length === 0, "removes the `categories-list` class");
|
2014-08-29 02:34:31 +08:00
|
|
|
ok(exists('.topic-list .topic-list-item'), "has topics");
|
2014-08-01 06:07:04 +08:00
|
|
|
});
|
2017-03-09 00:31:30 +08:00
|
|
|
|
|
|
|
visit("/c/feature");
|
|
|
|
andThen(() => {
|
|
|
|
ok(exists(".topic-list"), "The list of topics was rendered");
|
|
|
|
ok(exists(".category-boxes"), "The list of subcategories were rendered with box style");
|
|
|
|
});
|
2013-06-21 03:02:02 +08:00
|
|
|
});
|