mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 21:19:41 -06:00
parent
f0abad6998
commit
f2be253b7c
@ -1,10 +1,10 @@
|
||||
import Category from "discourse/models/category";
|
||||
import EmberObject from "@ember/object";
|
||||
import Topic from "discourse/models/topic";
|
||||
import User from "discourse/models/user";
|
||||
import { discourseModule } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { IMAGE_VERSION as v } from "pretty-text/emoji/version";
|
||||
import createStore from "discourse/tests/helpers/create-store";
|
||||
|
||||
discourseModule("Unit | Model | topic", function () {
|
||||
test("defaults", function (assert) {
|
||||
@ -36,7 +36,9 @@ discourseModule("Unit | Model | topic", function () {
|
||||
});
|
||||
|
||||
test("lastUnreadUrl", function (assert) {
|
||||
const category = EmberObject.create({
|
||||
const store = createStore();
|
||||
const category = store.createRecord("category", {
|
||||
id: 22,
|
||||
navigate_to_first_post_after_read: true,
|
||||
});
|
||||
|
||||
@ -45,10 +47,9 @@ discourseModule("Unit | Model | topic", function () {
|
||||
highest_post_number: 10,
|
||||
last_read_post_number: 10,
|
||||
slug: "hello",
|
||||
category_id: category.id,
|
||||
});
|
||||
|
||||
topic.set("category", category);
|
||||
|
||||
assert.strictEqual(topic.get("lastUnreadUrl"), "/t/hello/101/1");
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user