2021-06-24 19:30:01 +02:00
|
|
|
"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!"}));
|
2021-11-30 06:26:05 +01:00
|
|
|
assert.ok(!$("#compose-send-button .loader").visible());
|
2021-06-24 19:30:01 +02:00
|
|
|
assert.ok($("#compose-textarea").is_focused());
|
2021-06-25 13:36:43 +02:00
|
|
|
|
|
|
|
$("#compose-send-status").fadeOut = (prop) => {
|
|
|
|
assert.equal(prop, 500);
|
|
|
|
return "none";
|
|
|
|
};
|
|
|
|
|
|
|
|
compose_error.hide();
|
2021-06-24 19:30:01 +02:00
|
|
|
});
|