Files
discourse/test/javascripts/acceptance/category-chooser-test.js.es6
T

33 lines
869 B
JavaScript
Raw Normal View History

2018-06-15 17:03:24 +02:00
import { acceptance } from "helpers/qunit-helpers";
2017-08-28 14:34:04 +02:00
2018-06-15 17:03:24 +02:00
acceptance("CategoryChooser", {
2017-08-28 14:34:04 +02:00
loggedIn: true,
settings: {
allow_uncategorized_topics: false
}
});
QUnit.test("does not display uncategorized if not allowed", async assert => {
2018-06-15 17:03:24 +02:00
const categoryChooser = selectKit(".category-chooser");
2017-12-22 13:08:12 +01:00
await visit("/");
await click("#create-topic");
2017-08-28 14:34:04 +02:00
2018-07-29 22:51:32 +02:00
await categoryChooser.expand();
2017-10-19 12:51:08 -07:00
assert.ok(categoryChooser.rowByIndex(0).name() !== "uncategorized");
2017-08-28 14:34:04 +02:00
});
2018-07-20 17:48:18 +05:30
// TO-DO: fix the test to work with new code to land on category page
// (https://github.com/discourse/discourse/commit/7d9c97d66141d35d00258fe544211d9fd7f79a76)
// QUnit.test("prefill category when category_id is set", async assert => {
// await visit("/new-topic?category_id=1");
2017-08-28 14:34:04 +02:00
2018-07-20 17:48:18 +05:30
// assert.equal(
// selectKit(".category-chooser")
// .header()
// .value(),
// 1
// );
// });