2020-08-01 03:43:15 +02:00
|
|
|
"use strict";
|
|
|
|
|
2020-11-30 23:46:45 +01:00
|
|
|
const {strict: assert} = require("assert");
|
|
|
|
|
2021-06-16 15:58:34 +02:00
|
|
|
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
2020-12-01 00:39:47 +01:00
|
|
|
const {run_test} = require("../zjsunit/test");
|
2021-02-21 15:38:51 +01:00
|
|
|
const $ = require("../zjsunit/zjquery");
|
2020-12-01 00:02:16 +01:00
|
|
|
|
2021-03-10 06:10:32 +01:00
|
|
|
const upload_widget = mock_esm("../../static/js/upload_widget");
|
2021-02-10 04:53:22 +01:00
|
|
|
const settings_emoji = zrequire("settings_emoji");
|
2020-07-24 00:02:31 +02:00
|
|
|
|
2022-03-29 18:46:59 +02:00
|
|
|
run_test("add_custom_emoji_post_render", () => {
|
2020-07-24 00:02:31 +02:00
|
|
|
let build_widget_stub = false;
|
2021-02-23 14:37:26 +01:00
|
|
|
upload_widget.build_widget = (
|
2020-07-24 00:02:31 +02:00
|
|
|
get_file_input,
|
|
|
|
file_name_field,
|
|
|
|
input_error,
|
|
|
|
clear_button,
|
|
|
|
upload_button,
|
2021-02-23 14:37:26 +01:00
|
|
|
) => {
|
2020-07-24 00:02:31 +02:00
|
|
|
assert.deepEqual(get_file_input(), $("#emoji_file_input"));
|
|
|
|
assert.deepEqual(file_name_field, $("#emoji-file-name"));
|
|
|
|
assert.deepEqual(input_error, $("#emoji_file_input_error"));
|
|
|
|
assert.deepEqual(clear_button, $("#emoji_image_clear_button"));
|
|
|
|
assert.deepEqual(upload_button, $("#emoji_upload_button"));
|
|
|
|
build_widget_stub = true;
|
|
|
|
};
|
2022-03-29 18:46:59 +02:00
|
|
|
settings_emoji.add_custom_emoji_post_render();
|
2021-06-10 08:32:54 +02:00
|
|
|
assert.ok(build_widget_stub);
|
2020-07-24 00:02:31 +02:00
|
|
|
});
|