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
|
|
|
|
2017-06-15 01:57:58 +08:00
|
|
|
QUnit.test("Visit Discovery Pages", assert => {
|
2014-07-31 01:27:14 +08:00
|
|
|
visit("/");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.ok($("body.navigation-topics").length, "has the default navigation");
|
2017-06-15 01:57:58 +08:00
|
|
|
assert.ok(exists(".topic-list"), "The list of topics was rendered");
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.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(() => {
|
2017-06-15 01:57:58 +08:00
|
|
|
assert.ok(exists(".topic-list"), "The list of topics was rendered");
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.ok(exists(".topic-list .topic-list-item"), "has topics");
|
|
|
|
assert.ok(!exists(".category-list"), "doesn't render subcategories");
|
|
|
|
assert.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(() => {
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.ok($("body.navigation-categories").length, "has the body class");
|
|
|
|
assert.ok(
|
|
|
|
$("body.category-bug").length === 0,
|
|
|
|
"removes the custom category class"
|
|
|
|
);
|
|
|
|
assert.ok(exists(".category"), "has a list of categories");
|
|
|
|
assert.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(() => {
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.ok(
|
|
|
|
$("body.categories-list").length === 0,
|
|
|
|
"removes the `categories-list` class"
|
|
|
|
);
|
|
|
|
assert.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(() => {
|
2017-06-15 01:57:58 +08:00
|
|
|
assert.ok(exists(".topic-list"), "The list of topics was rendered");
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.ok(
|
|
|
|
exists(".category-boxes"),
|
|
|
|
"The list of subcategories were rendered with box style"
|
|
|
|
);
|
2017-03-09 00:31:30 +08:00
|
|
|
});
|
2017-03-16 05:34:38 +08:00
|
|
|
|
|
|
|
visit("/c/dev");
|
|
|
|
andThen(() => {
|
2017-06-15 01:57:58 +08:00
|
|
|
assert.ok(exists(".topic-list"), "The list of topics was rendered");
|
2018-06-15 23:03:24 +08:00
|
|
|
assert.ok(
|
|
|
|
exists(".category-boxes-with-topics"),
|
|
|
|
"The list of subcategories were rendered with box-with-featured-topics style"
|
|
|
|
);
|
|
|
|
assert.ok(
|
|
|
|
exists(".category-boxes-with-topics .featured-topics"),
|
|
|
|
"The featured topics are there too"
|
|
|
|
);
|
2017-03-16 05:34:38 +08:00
|
|
|
});
|
2018-06-15 23:03:24 +08:00
|
|
|
});
|