diff --git a/test/javascripts/widgets/small-action-post-class-test.js b/test/javascripts/widgets/small-action-post-class-test.js index ad3247f..975ddf3 100644 --- a/test/javascripts/widgets/small-action-post-class-test.js +++ b/test/javascripts/widgets/small-action-post-class-test.js @@ -10,7 +10,7 @@ discourseModule( function (hooks) { setupRenderingTest(hooks); - test("When assigns are not public add a private-assign class to the small post", async function (assert) { + test("Adds private-assign class when assigns are not public", async function (assert) { this.siteSettings.assigns_public = false; this.set("args", { @@ -34,9 +34,27 @@ discourseModule( ); assert.ok(exists(".small-action.private-assign")); + }); + test("Does not add private-assign class when assigns are public", async function (assert) { this.siteSettings.assigns_public = true; + 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`` );