FIX: Regressions in JS test suite

This commit is contained in:
Robin Ward 2019-03-28 14:15:52 -04:00
parent c44371b4ac
commit 3660b85614
2 changed files with 5 additions and 7 deletions

View File

@ -4,10 +4,7 @@ import { ButtonClass } from "discourse/widgets/button";
createWidget(
"post-admin-menu-button",
jQuery.extend(ButtonClass, {
tagName: "li.btn",
secondaryAction: "closeAdminMenu"
})
jQuery.extend(ButtonClass, { tagName: "li.btn" })
);
export function buildManageButtons(attrs, currentUser, siteSettings) {
@ -117,6 +114,7 @@ export default createWidget("post-admin-menu", {
buildManageButtons(this.attrs, this.currentUser, this.siteSettings).forEach(
b => {
b.secondaryAction = "closeAdminMenu";
contents.push(this.attach("post-admin-menu-button", b));
}
);

View File

@ -54,14 +54,14 @@ widgetTest("staff menu", {
beforeEach() {
this.currentUser.setProperties({
staff: true,
site_flagged_posts_count: 3
reviewable_count: 3
});
},
test(assert) {
assert.ok(find(".admin-link").length);
assert.ok(find(".flagged-posts-link").length);
assert.equal(find(".flagged-posts").text(), "3");
assert.ok(find(".review").length);
assert.equal(find(".reviewables").text(), "3");
assert.ok(!find(".settings-link").length);
}
});