2022-03-04 11:14:07 +01:00
|
|
|
"use strict";
|
|
|
|
|
2024-10-09 00:25:41 +02:00
|
|
|
const assert = require("node:assert/strict");
|
2022-03-04 11:14:07 +01:00
|
|
|
|
2023-02-22 23:04:10 +01:00
|
|
|
const {get_stream_email_address} = require("../src/stream_edit");
|
|
|
|
|
|
|
|
const {run_test} = require("./lib/test");
|
2022-03-04 11:14:07 +01:00
|
|
|
|
|
|
|
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");
|
|
|
|
});
|