<reponame>oluchigoodness2000/zulip<filename>frontend_tests/node_tests/stream_edit.js<gh_stars>0"use strict";

const {strict: assert} = require("assert");

const {get_stream_email_address} = require("../../static/js/stream_edit");
const {run_test} = require("../zjsunit/test");

run_test("get_stream_email_address", () => {
    let address = "kenaa@example.com";
    let flags = ["show-sender", "include-footer"];

    let new_address = get_stream_email_address(flags, address);
    assert.equal(
        new_address,
        "upchh@example.com",
    );

    address = "dycjh@example.com";

    new_address = get_stream_email_address(flags, address);
    assert.equal(
        new_address,
        "upchh@example.com",
    );

    flags = [];

    new_address = get_stream_email_address(flags, address);
    assert.equal(new_address, "kenaa@example.com");
});
