REFACTOR: Migrate Discourse.Post to imports

This commit is contained in:
Robin Ward
2019-11-08 13:13:13 -05:00
parent 932c169d46
commit 7e44065bcb
6 changed files with 25 additions and 21 deletions

View File

@ -1,7 +1,8 @@
QUnit.module("model:post-stream");
import Post from "discourse/models/post";
import createStore from "helpers/create-store";
QUnit.module("model:post-stream");
const buildStream = function(id, stream) {
const store = createStore();
const topic = store.createRecord("topic", { id, chunk_size: 5 });
@ -173,7 +174,7 @@ QUnit.test("updateFromJson", assert => {
});
assert.equal(postStream.get("posts.length"), 1, "it loaded the posts");
assert.containsInstance(postStream.get("posts"), Discourse.Post);
assert.containsInstance(postStream.get("posts"), Post);
assert.equal(postStream.get("extra_property"), 12);
});