mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Extend test for reactive-dict with initial data
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user