mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 10:06:17 +08:00
FIX: Permit unpinning an unlisted topic.
This commit is contained in:
parent
f666d72606
commit
8f39cf6bfc
|
@ -184,8 +184,8 @@ export default createWidget("topic-admin-menu", {
|
|||
|
||||
const isPrivateMessage = topic.get("isPrivateMessage");
|
||||
|
||||
if (!isPrivateMessage && topic.get("visible")) {
|
||||
const featured = topic.get("pinned_at") || topic.get("isBanner");
|
||||
const featured = topic.get("pinned_at") || topic.get("isBanner");
|
||||
if (!isPrivateMessage && (topic.get("visible") || featured)) {
|
||||
buttons.push({
|
||||
className: "topic-admin-pin",
|
||||
action: "showFeatureTopic",
|
||||
|
|
|
@ -7,6 +7,18 @@ acceptance("Topic", {
|
|||
server.put("/posts/398/wiki", () => {
|
||||
return helper.response({});
|
||||
});
|
||||
|
||||
server.get("/topics/feature_stats.json", () => {
|
||||
return helper.response({
|
||||
pinned_in_category_count: 0,
|
||||
pinned_globally_count: 0,
|
||||
banner_count: 0
|
||||
});
|
||||
});
|
||||
|
||||
server.put("/t/280/make-banner", () => {
|
||||
return helper.response({});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -215,6 +227,23 @@ QUnit.test("remove featured link", async assert => {
|
|||
// assert.ok(!exists('.title-wrapper .topic-featured-link'), 'link is gone');
|
||||
});
|
||||
|
||||
QUnit.test("Unpinning unlisted topic", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
|
||||
await click(".toggle-admin-menu");
|
||||
await click(".topic-admin-pin .btn");
|
||||
await click(".btn-primary:last");
|
||||
|
||||
await click(".toggle-admin-menu");
|
||||
await click(".topic-admin-visible .btn");
|
||||
|
||||
await click(".toggle-admin-menu");
|
||||
assert.ok(
|
||||
exists(".topic-admin-pin"),
|
||||
"it should show the multi select menu"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("selecting posts", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click(".toggle-admin-menu");
|
||||
|
|
Loading…
Reference in New Issue
Block a user