FIX: use tag model instead of tagId property. (#11298)

In a recent commit 866fa008d4 support for tagId property is removed.

And added a test case. Follow-up for 2d5bb516a6aa035dca11dd55dfbb5b796c54c166.
This commit is contained in:
Vinoth Kannan 2020-11-23 16:40:15 +05:30 committed by GitHub
parent 20c0da8516
commit 139c5dc356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 2 deletions

View File

@ -3,7 +3,7 @@
{{category-drop {{category-drop
category=breadcrumb.category category=breadcrumb.category
categories=breadcrumb.options categories=breadcrumb.options
tagId=tagId tagId=tag.id
options=(hash options=(hash
parentCategory=breadcrumb.parentCategory parentCategory=breadcrumb.parentCategory
subCategory=breadcrumb.isSubcategory subCategory=breadcrumb.isSubcategory

View File

@ -1,6 +1,6 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers"; import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { exists } from "discourse/tests/helpers/qunit-helpers"; import { exists } from "discourse/tests/helpers/qunit-helpers";
import { click, visit } from "@ember/test-helpers"; import { click, visit, currentURL } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { import {
updateCurrentUser, updateCurrentUser,
@ -179,6 +179,28 @@ acceptance("Tag info", function (needs) {
}); });
}); });
server.get("/tags/c/faq/4/planters/l/latest.json", () => {
return helper.response({
users: [],
primary_groups: [],
topic_list: {
can_create_topic: true,
draft: null,
draft_key: "new_topic",
draft_sequence: 1,
per_page: 30,
tags: [
{
id: 1,
name: "planters",
topic_count: 1,
},
],
topics: [],
},
});
});
server.get("/tag/planters/info", () => { server.get("/tag/planters/info", () => {
return helper.response({ return helper.response({
__rest_serializer: "1", __rest_serializer: "1",
@ -250,6 +272,15 @@ acceptance("Tag info", function (needs) {
assert.ok(!exists("#delete-tag"), "can't delete tag"); assert.ok(!exists("#delete-tag"), "can't delete tag");
}); });
test("can filter tags page by category", async function (assert) {
await visit("/tag/planters");
await click(".category-breadcrumb .category-drop-header");
await click('.category-breadcrumb .category-row[data-name="faq"]');
assert.equal(currentURL(), "/tags/c/faq/4/planters");
});
test("admin can manage tags", async function (assert) { test("admin can manage tags", async function (assert) {
updateCurrentUser({ moderator: false, admin: true }); updateCurrentUser({ moderator: false, admin: true });