Files
zulip/frontend_tests/node_tests/compose_error.js
Priyam Seth 939d8dab7b compose: Extract compose_error.js.
This commit moves the compose_error function to its own module, which
will be useful for future work splitting the compose module.

We also simplify compose_not_subscribed_error to call the
compose_error show function.
2021-06-24 16:19:22 -07:00

21 lines
774 B
JavaScript

"use strict";
const {strict: assert} = require("assert");
const {$t} = require("../zjsunit/i18n");
const {zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");
const $ = require("../zjsunit/zjquery");
const compose_error = zrequire("compose_error");
run_test("compose_error_test", () => {
compose_error.show($t({defaultMessage: "You have nothing to send!"}), $("#compose-textarea"));
assert.ok($("#compose-send-status").hasClass("alert-error"));
assert.equal($("#compose-error-msg").html(), $t({defaultMessage: "You have nothing to send!"}));
assert.equal($("#compose-send-button").prop("disabled"), false);
assert.ok(!$("#sending-indicator").visible());
assert.ok($("#compose-textarea").is_focused());
});