summaryrefslogtreecommitdiffstats
path: root/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_block_message.js
blob: 0671253b437f20295402120b9c482312b49ed12e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();
});