mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 16:22:20 +08:00
@ -14,9 +14,7 @@ export default Ember.ArrayProxy.extend({
|
|||||||
renderIconIf("archived", "lock", "archived");
|
renderIconIf("archived", "lock", "archived");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.forEach(args => {
|
this.forEach(args => renderIconIf(...args));
|
||||||
renderIconIf(...args);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).create({
|
}).create({
|
||||||
content: [
|
content: [
|
||||||
|
@ -14,8 +14,8 @@ export default createWidget("topic-status", {
|
|||||||
const result = [];
|
const result = [];
|
||||||
|
|
||||||
TopicStatusIcons.render(topic, function(name, key) {
|
TopicStatusIcons.render(topic, function(name, key) {
|
||||||
const iconArgs = key === "unpinned" ? { class: "unpinned" } : null,
|
const iconArgs = key === "unpinned" ? { class: "unpinned" } : null;
|
||||||
icon = iconNode(name, iconArgs);
|
const icon = iconNode(name, iconArgs);
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
title: escapeExpression(I18n.t(`topic_statuses.${key}.help`))
|
title: escapeExpression(I18n.t(`topic_statuses.${key}.help`))
|
||||||
|
37
test/javascripts/widgets/topic-status-test.js.es6
Normal file
37
test/javascripts/widgets/topic-status-test.js.es6
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { moduleForWidget, widgetTest } from "helpers/widget-test";
|
||||||
|
import TopicStatusIcons from "discourse/helpers/topic-status-icons";
|
||||||
|
|
||||||
|
moduleForWidget("topic-status");
|
||||||
|
|
||||||
|
widgetTest("basics", {
|
||||||
|
template: '{{mount-widget widget="topic-status" args=args}}',
|
||||||
|
beforeEach(store) {
|
||||||
|
this.set("args", {
|
||||||
|
topic: store.createRecord("topic", { closed: true }),
|
||||||
|
disableActions: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
test(assert) {
|
||||||
|
assert.ok(find(".topic-status .d-icon-lock").length);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
widgetTest("extendability", {
|
||||||
|
template: '{{mount-widget widget="topic-status" args=args}}',
|
||||||
|
beforeEach(store) {
|
||||||
|
TopicStatusIcons.addObject([
|
||||||
|
"has_accepted_answer",
|
||||||
|
"check-square-o",
|
||||||
|
"solved"
|
||||||
|
]);
|
||||||
|
this.set("args", {
|
||||||
|
topic: store.createRecord("topic", {
|
||||||
|
has_accepted_answer: true
|
||||||
|
}),
|
||||||
|
disableActions: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
test(assert) {
|
||||||
|
assert.ok(find(".topic-status .d-icon-check-square-o").length);
|
||||||
|
}
|
||||||
|
});
|
Reference in New Issue
Block a user