2022-03-04 11:14:07 +01:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const {strict: assert} = require("assert");
|
|
|
|
|
2023-02-22 23:03:47 +01:00
|
|
|
const {get_stream_email_address} = require("../../web/src/stream_edit");
|
2022-03-04 11:14:07 +01:00
|
|
|
const {run_test} = require("../zjsunit/test");
|
|
|
|
|
|
|
|
run_test("get_stream_email_address", () => {
|
|
|
|
let address = "announce.747b04693224b5d2f0d409b66ccd3866@zulipdev.com";
|
|
|
|
let flags = ["show-sender", "include-footer"];
|
|
|
|
|
|
|
|
let new_address = get_stream_email_address(flags, address);
|
|
|
|
assert.equal(
|
|
|
|
new_address,
|
|
|
|
"announce.747b04693224b5d2f0d409b66ccd3866.show-sender.include-footer@zulipdev.com",
|
|
|
|
);
|
|
|
|
|
|
|
|
address = "announce.747b04693224b5d2f0d409b66ccd3866.include-quotes@zulipdev.com";
|
|
|
|
|
|
|
|
new_address = get_stream_email_address(flags, address);
|
|
|
|
assert.equal(
|
|
|
|
new_address,
|
|
|
|
"announce.747b04693224b5d2f0d409b66ccd3866.show-sender.include-footer@zulipdev.com",
|
|
|
|
);
|
|
|
|
|
|
|
|
flags = [];
|
|
|
|
|
|
|
|
new_address = get_stream_email_address(flags, address);
|
|
|
|
assert.equal(new_address, "announce.747b04693224b5d2f0d409b66ccd3866@zulipdev.com");
|
|
|
|
});
|