list_render: Error if opts are missing.

The check here was too late, and it should
have given a blueslip error.  We obviously
don't expect these errors at runtime; this
is a convenience for developers creating
new widgets.
This commit is contained in:
Steve Howell
2020-04-24 13:38:16 +00:00
committed by showell
parent 5308f892d8
commit 059ad86967
2 changed files with 15 additions and 3 deletions

View File

@@ -453,3 +453,13 @@ run_test('clear_event_handlers', () => {
assert.equal(scroll_container.cleared, true);
assert.equal(filter_element.cleared, true);
});
run_test('errors', () => {
// We don't care about actual data for this test.
const list = 'stub';
const container = 'stub';
blueslip.expect('error', 'Need opts to create widget.');
list_render.create(container, list);
blueslip.reset();
});