2022-08-19 21:36:33 +02:00
|
|
|
"use strict";
|
|
|
|
|
2023-02-22 23:04:10 +01:00
|
|
|
const compose_banner = require("../../src/compose_banner");
|
|
|
|
|
|
|
|
const $ = require("./zjquery");
|
2022-08-19 21:36:33 +02:00
|
|
|
|
|
|
|
exports.mock_banners = () => {
|
|
|
|
// zjquery doesn't support `remove`, which is used when clearing the compose box.
|
|
|
|
// TODO: improve how we test this so that we don't have to mock things like this.
|
|
|
|
for (const classname of Object.values(compose_banner.CLASSNAMES)) {
|
2023-04-13 18:40:17 +02:00
|
|
|
$(`#compose_banners .${classname.replaceAll(" ", ".")}`).remove = () => {};
|
2022-08-19 21:36:33 +02:00
|
|
|
}
|
2022-12-10 01:20:07 +01:00
|
|
|
$("#compose_banners .warning").remove = () => {};
|
|
|
|
$("#compose_banners .error").remove = () => {};
|
2022-08-19 21:36:33 +02:00
|
|
|
};
|