2015-04-16 12:53:30 -05:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Topic - Anonymous");
|
|
|
|
|
2018-07-19 09:40:12 -05:00
|
|
|
QUnit.test("Enter a Topic", async assert => {
|
|
|
|
await visit("/t/internationalization-localization/280/1");
|
|
|
|
assert.ok(exists("#topic"), "The topic was rendered");
|
|
|
|
assert.ok(exists("#topic .cooked"), "The topic has cooked posts");
|
|
|
|
assert.ok(
|
|
|
|
find(".shared-draft-notice").length === 0,
|
|
|
|
"no shared draft unless there's a dest category id"
|
|
|
|
);
|
2015-04-16 12:53:30 -05:00
|
|
|
});
|
|
|
|
|
2018-07-19 09:40:12 -05:00
|
|
|
QUnit.test("Enter without an id", async assert => {
|
|
|
|
await visit("/t/internationalization-localization");
|
|
|
|
assert.ok(exists("#topic"), "The topic was rendered");
|
2015-04-16 12:53:30 -05:00
|
|
|
});
|
2015-05-27 12:53:49 -05:00
|
|
|
|
2018-07-19 09:40:12 -05:00
|
|
|
QUnit.test("Enter a 404 topic", async assert => {
|
|
|
|
await visit("/t/not-found/404");
|
|
|
|
assert.ok(!exists("#topic"), "The topic was not rendered");
|
|
|
|
assert.ok(
|
|
|
|
find(".not-found").text() === "not found",
|
|
|
|
"it renders the error message"
|
|
|
|
);
|
2015-06-10 12:12:15 -05:00
|
|
|
});
|
|
|
|
|
2018-07-19 09:40:12 -05:00
|
|
|
QUnit.test("Enter without access", async assert => {
|
|
|
|
await visit("/t/i-dont-have-access/403");
|
|
|
|
assert.ok(!exists("#topic"), "The topic was not rendered");
|
|
|
|
assert.ok(exists(".topic-error"), "An error message is displayed");
|
2015-05-27 12:53:49 -05:00
|
|
|
});
|
|
|
|
|
2018-07-19 09:40:12 -05:00
|
|
|
QUnit.test("Enter with 500 errors", async assert => {
|
|
|
|
await visit("/t/throws-error/500");
|
|
|
|
assert.ok(!exists("#topic"), "The topic was not rendered");
|
|
|
|
assert.ok(exists(".topic-error"), "An error message is displayed");
|
2018-03-13 14:59:12 -05:00
|
|
|
});
|