summaryrefslogtreecommitdiffstats
path: root/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js')
-rw-r--r--toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js b/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js
new file mode 100644
index 0000000000..0671253b43
--- /dev/null
+++ b/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js
@@ -0,0 +1,23 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+add_task(async function test_block_message() {
+ let blockStub = sinon.stub(SpecialMessageActions, "blockMessageById");
+
+ await SMATestUtils.executeAndValidateAction({
+ type: "BLOCK_MESSAGE",
+ data: {
+ id: "TEST_MESSAGE_ID",
+ },
+ });
+
+ Assert.equal(blockStub.callCount, 1, "blockMessageById called by the action");
+ Assert.equal(
+ blockStub.firstCall.args[0],
+ "TEST_MESSAGE_ID",
+ "Argument is message id"
+ );
+ blockStub.restore();
+});