From 4b755332b947c99b8327eccd909d528043c144dd Mon Sep 17 00:00:00 2001 From: awesomerobot Date: Mon, 19 Dec 2022 18:03:39 -0500 Subject: [PATCH] fix test failure --- .../widgets/small-action-post-class-test.js | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/test/javascripts/widgets/small-action-post-class-test.js b/test/javascripts/widgets/small-action-post-class-test.js index 4169e64..89d9eb4 100644 --- a/test/javascripts/widgets/small-action-post-class-test.js +++ b/test/javascripts/widgets/small-action-post-class-test.js @@ -12,36 +12,6 @@ discourseModule( setupRenderingTest(hooks); test("Adds private-assign class when assigns are not public", async function (assert) { - try { - this.siteSettings.assigns_public = false; - - this.set("args", { - id: 10, - actionCode: "assigned", - }); - - withPluginApi("1.6.0", (api) => { - api.addPostSmallActionClassesCallback((post) => { - if ( - post.actionCode.includes("assigned") && - !this.siteSettings.assigns_public - ) { - return ["private-assign"]; - } - }); - }); - - await render( - hbs`` - ); - - assert.ok(exists(".small-action.private-assign")); - } finally { - resetPostSmallActionClassesCallbacks(); - } - }); - - test("Does not add private-assign class when assigns are public", async function (assert) { try { this.siteSettings.assigns_public = true; @@ -65,7 +35,21 @@ discourseModule( hbs`` ); - assert.ok(!exists(".small-action.private-assign")); + assert.notOk( + exists(".small-action.private-assign"), + "adds the private-assign class when assigns are public" + ); + + this.siteSettings.assigns_public = false; + + await render( + hbs`` + ); + + assert.ok( + exists(".small-action.private-assign"), + "adds the private-assign class when assigns are NOT public" + ); } finally { resetPostSmallActionClassesCallbacks(); }