widgetize: Don't warn for deleted tictactoe widget.

This commit is contained in:
YashRE42 2020-11-09 10:22:48 +00:00 committed by Steve Howell
parent 909b484d64
commit d9b14b5b74
2 changed files with 10 additions and 0 deletions

View File

@ -135,6 +135,13 @@ run_test("activate", () => {
assert(!is_event_handled);
assert.equal(blueslip.get_test_logs("warn")[0].more_info, "invalid_widget");
opts.widget_type = "tictactoe";
widgetize.activate(opts);
assert(!is_widget_elem_inserted);
assert(!is_widget_activated);
assert(!is_event_handled);
/* Testing widgetize.handle_events */
const post_activate_event = {
data: {

View File

@ -25,6 +25,9 @@ exports.activate = function (in_opts) {
events.shift();
if (!widgets.has(widget_type)) {
if (widget_type === "tictactoe") {
return; // don't warn for deleted legacy widget
}
blueslip.warn("unknown widget_type", widget_type);
return;
}