FEATURE: Include a user's pending posts in the topic view

Also includes a refactor to TopicView's serializer which was not
building our attributes using serializers properly.
This commit is contained in:
Robin Ward
2019-04-12 09:55:27 -04:00
parent 1760069419
commit a5d9afe397
26 changed files with 503 additions and 131 deletions
@@ -255,6 +255,8 @@ QUnit.test("Posting on a different topic", async assert => {
QUnit.test("Create an enqueued Reply", async assert => {
await visit("/t/internationalization-localization/280");
assert.notOk(find(".pending-posts .reviewable-item").length);
await click("#topic-footer-buttons .btn.create");
assert.ok(exists(".d-editor-input"), "the composer input is visible");
assert.ok(!exists("#reply-title"), "there is no title since this is a reply");
@@ -270,6 +272,8 @@ QUnit.test("Create an enqueued Reply", async assert => {
await click(".modal-footer button");
assert.ok(invisible(".d-modal"), "the modal can be dismissed");
assert.ok(find(".pending-posts .reviewable-item").length);
});
QUnit.test("Edit the first post", async assert => {
+1
View File
@@ -1,6 +1,7 @@
/*jshint maxlen:10000000 */
export default {
"/t/280/1.json": {
pending_posts: [],
post_stream: {
posts: [
{
@@ -430,7 +430,14 @@ export default function() {
}
if (data.raw === "enqueue this content please") {
return response(200, { success: true, action: "enqueued" });
return response(200, {
success: true,
action: "enqueued",
pending_post: {
id: 1234,
raw: data.raw
}
});
}
return response(200, {