Extend test for reactive-dict with initial data

This commit is contained in:
Simon Fridlund
2017-05-05 19:56:11 +02:00
parent c674c6994c
commit e7e377eff8

View File

@@ -11,9 +11,25 @@ Tinytest.add('ReactiveDict - initialize with data', function (test) {
var dict = new ReactiveDict({
now: now
});
var nowFromDict = dict.get('now');
test.equal(nowFromDict, now);
// Test with static value here as a named dict could
// be migrated if code reload happens while testing
dict = new ReactiveDict('foo', {
foo: 'bar'
});
nowFromDict = dict.get('foo');
test.equal(nowFromDict, 'bar');
dict = new ReactiveDict(undefined, {
now: now
});
nowFromDict = dict.get('now');
test.equal(nowFromDict, now);
});
Tinytest.add('ReactiveDict - setDefault', function (test) {