mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							c176891c2e
						
					
				
				
					commit
					a197959959
				
			@@ -4,7 +4,7 @@ set_global('$', global.make_zjquery());
 | 
				
			|||||||
set_global('i18n', global.stub_i18n);
 | 
					set_global('i18n', global.stub_i18n);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set_global('people', {});
 | 
					set_global('people', {});
 | 
				
			||||||
set_global('blueslip', {});
 | 
					set_global('blueslip', global.make_zblueslip());
 | 
				
			||||||
set_global('templates', {});
 | 
					set_global('templates', {});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const noop = () => {};
 | 
					const noop = () => {};
 | 
				
			||||||
@@ -90,11 +90,11 @@ run_test('poll_data_holder my question', () => {
 | 
				
			|||||||
        vote: 1,
 | 
					        vote: 1,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    blueslip.error = (msg) => {
 | 
					    blueslip.set_test_data('warn', `unknown key for poll: ${invalid_vote_event.key}`);
 | 
				
			||||||
        assert.equal(msg, `unknown key for poll: ${invalid_vote_event.key}`);
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    data_holder.handle_event(sender_id, invalid_vote_event);
 | 
					    data_holder.handle_event(sender_id, invalid_vote_event);
 | 
				
			||||||
    data = data_holder.get_widget_data();
 | 
					    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');
 | 
					    const option_outbound_event = data_holder.handle.new_option.outbound('new option');
 | 
				
			||||||
    assert.deepEqual(option_outbound_event, {
 | 
					    assert.deepEqual(option_outbound_event, {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -138,7 +138,7 @@ exports.poll_data_holder = function (is_my_poll, question, options) {
 | 
				
			|||||||
                var option = key_to_option[key];
 | 
					                var option = key_to_option[key];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (option === undefined) {
 | 
					                if (option === undefined) {
 | 
				
			||||||
                    blueslip.error('unknown key for poll: ' + key);
 | 
					                    blueslip.warn('unknown key for poll: ' + key);
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user