Show More
@@ -59,13 +59,27 casper.notebook_test(function () { | |||||
59 | JSON.stringify(input) + ' passed through Model._pack_model unchanged'); |
|
59 | JSON.stringify(input) + ' passed through Model._pack_model unchanged'); | |
60 | }; |
|
60 | }; | |
61 | var test_unpack = function (input) { |
|
61 | var test_unpack = function (input) { | |
62 |
|
|
62 | that.thenEvaluate(function(input) { | |
|
63 | window.results = undefined; | |||
63 | var model = new IPython.WidgetModel(IPython.notebook.kernel.widget_manager, undefined); |
|
64 | var model = new IPython.WidgetModel(IPython.notebook.kernel.widget_manager, undefined); | |
64 |
|
|
65 | model._unpack_models(input).then(function(results) { | |
65 |
|
|
66 | window.results = results; | |
|
67 | }); | |||
66 | }, {input: input}); |
|
68 | }, {input: input}); | |
67 | that.test.assert(recursive_compare(input, output), |
|
69 | ||
68 | JSON.stringify(input) + ' passed through Model._unpack_model unchanged'); |
|
70 | that.waitFor(function check() { | |
|
71 | return that.evaluate(function() { | |||
|
72 | return window.results; | |||
|
73 | }); | |||
|
74 | }); | |||
|
75 | ||||
|
76 | that.then(function() { | |||
|
77 | var results = that.evaluate(function() { | |||
|
78 | return window.results; | |||
|
79 | }); | |||
|
80 | that.test.assert(recursive_compare(input, results), | |||
|
81 | JSON.stringify(input) + ' passed through Model._unpack_model unchanged'); | |||
|
82 | }); | |||
69 | }; |
|
83 | }; | |
70 | var test_packing = function(input) { |
|
84 | var test_packing = function(input) { | |
71 | test_pack(input); |
|
85 | test_pack(input); | |
@@ -84,7 +98,7 casper.notebook_test(function () { | |||||
84 | test_packing([String('hi'), Date("Thu Nov 13 2014 13:46:21 GMT-0500")]) |
|
98 | test_packing([String('hi'), Date("Thu Nov 13 2014 13:46:21 GMT-0500")]) | |
85 |
|
99 | |||
86 | // Test multi-set, single touch code. First create a custom widget. |
|
100 | // Test multi-set, single touch code. First create a custom widget. | |
87 | this.evaluate(function() { |
|
101 | this.thenEvaluate(function() { | |
88 | var MultiSetView = IPython.DOMWidgetView.extend({ |
|
102 | var MultiSetView = IPython.DOMWidgetView.extend({ | |
89 | render: function(){ |
|
103 | render: function(){ | |
90 | this.model.set('a', 1); |
|
104 | this.model.set('a', 1); |
General Comments 0
You need to be logged in to leave comments.
Login now