tests: Test dispatching stream create event.

This commit is contained in:
Joshua Pan 2018-08-17 23:56:09 -07:00 committed by showell
parent 6b61e54c08
commit e4a34c3512
1 changed files with 21 additions and 0 deletions

View File

@ -352,6 +352,15 @@ var event_fixtures = {
value: 'blue',
},
stream__create: {
type: 'stream',
op: 'create',
streams: [
{stream_id: 42},
{stream_id: 99},
],
},
subscription__add: {
type: 'subscription',
op: 'add',
@ -860,6 +869,18 @@ with_overrides(function (override) {
assert_same(args.property, event.property);
assert_same(args.value, event.value);
});
// stream create
event = event_fixtures.stream__create;
global.with_stub(function (stub) {
override('stream_data.create_streams', stub.f);
override('stream_data.get_sub_by_id', noop);
override('stream_data.update_calculated_fields', noop);
override('subs.add_sub_to_table', noop);
dispatch(event);
var args = stub.get_args('streams');
assert_same(_.pluck(args.streams, 'stream_id'), [42, 99]);
});
});
with_overrides(function (override) {