<reponame>devAyush007/zulip-main<filename>web/tests/stream_edit.test.js<gh_stars>0"use strict";

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

const {get_stream_email_address} = require("../src/stream_edit");

const {run_test} = require("./lib/test");

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

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

    address = "hzdkv@example.com";

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

    flags = [];

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