mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
@@ -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");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user