poll-widget: Downgrade key error to warning.

It is an error, but it is obnoxious in dev to get these.
This commit is contained in:
Rohitt Vashishtha
2019-01-28 20:50:35 +00:00
committed by Tim Abbott
parent c176891c2e
commit a197959959
2 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ set_global('$', global.make_zjquery());
set_global('i18n', global.stub_i18n);
set_global('people', {});
set_global('blueslip', {});
set_global('blueslip', global.make_zblueslip());
set_global('templates', {});
const noop = () => {};
@@ -90,11 +90,11 @@ run_test('poll_data_holder my question', () => {
vote: 1,
};
blueslip.error = (msg) => {
assert.equal(msg, `unknown key for poll: ${invalid_vote_event.key}`);
};
blueslip.set_test_data('warn', `unknown key for poll: ${invalid_vote_event.key}`);
data_holder.handle_event(sender_id, invalid_vote_event);
data = data_holder.get_widget_data();
assert.equal(blueslip.get_test_logs('warn').length, 1);
blueslip.clear_test_data();
const option_outbound_event = data_holder.handle.new_option.outbound('new option');
assert.deepEqual(option_outbound_event, {

View File

@@ -138,7 +138,7 @@ exports.poll_data_holder = function (is_my_poll, question, options) {
var option = key_to_option[key];
if (option === undefined) {
blueslip.error('unknown key for poll: ' + key);
blueslip.warn('unknown key for poll: ' + key);
return;
}