mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 20:13:43 +08:00
This reverts commit 0df7743d78
.
This causes too much instability in the unit test system, reverting
This commit is contained in:
parent
118ce348f4
commit
5893ad46ba
|
@ -506,12 +506,9 @@ export function getCategoryAndTagUrl(category, subcategories, tag) {
|
||||||
|
|
||||||
if (category) {
|
if (category) {
|
||||||
url = category.path;
|
url = category.path;
|
||||||
if (subcategories && (category.default_list_filter === "none" || tag)) {
|
if (subcategories && category.default_list_filter === "none") {
|
||||||
url += "/all";
|
url += "/all";
|
||||||
} else if (
|
} else if (!subcategories && category.default_list_filter === "all") {
|
||||||
!subcategories &&
|
|
||||||
(category.default_list_filter === "all" || tag)
|
|
||||||
) {
|
|
||||||
url += "/none";
|
url += "/none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,34 +141,6 @@ module("Unit | Utility | url", function () {
|
||||||
),
|
),
|
||||||
"/c/foo/1"
|
"/c/foo/1"
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.strictEqual(
|
|
||||||
getCategoryAndTagUrl(
|
|
||||||
{ path: "/c/foo/1", default_list_filter: "none" },
|
|
||||||
false,
|
|
||||||
"bar"
|
|
||||||
),
|
|
||||||
"/tags/c/foo/1/none/bar"
|
|
||||||
);
|
|
||||||
|
|
||||||
assert.strictEqual(
|
|
||||||
getCategoryAndTagUrl({ path: "/c/foo/1" }, false, "bar"),
|
|
||||||
"/tags/c/foo/1/none/bar"
|
|
||||||
);
|
|
||||||
|
|
||||||
assert.strictEqual(
|
|
||||||
getCategoryAndTagUrl(
|
|
||||||
{ path: "/c/foo/1", default_list_filter: "all" },
|
|
||||||
true,
|
|
||||||
"bar"
|
|
||||||
),
|
|
||||||
"/tags/c/foo/1/all/bar"
|
|
||||||
);
|
|
||||||
|
|
||||||
assert.strictEqual(
|
|
||||||
getCategoryAndTagUrl({ path: "/c/foo/1" }, true, "bar"),
|
|
||||||
"/tags/c/foo/1/all/bar"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("routeTo redirects secure uploads URLS because they are server side only", async function (assert) {
|
test("routeTo redirects secure uploads URLS because they are server side only", async function (assert) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user