@@ -84,6 +84,16 @@ describe('serialize/deserialize', function () {
84
84
model_id : 'widgetChild' ,
85
85
} ) ;
86
86
87
+ this . widgetChild2 = await this . manager . new_widget ( {
88
+ model_name : 'WidgetModel' ,
89
+ model_module : '@jupyter-widgets/base' ,
90
+ model_module_version : '1.2.0' ,
91
+ view_name : 'WidgetView' ,
92
+ view_module : '@jupyter-widgets/base' ,
93
+ view_module_version : '1.2.0' ,
94
+ model_id : 'widgetChild2' ,
95
+ } ) ;
96
+
87
97
this . widgetContainer = await this . manager . new_widget (
88
98
{
89
99
model_name : 'ContainerWidget' ,
@@ -111,6 +121,16 @@ describe('serialize/deserialize', function () {
111
121
children : [ 'IPY_MODEL_widgetChild' ] ,
112
122
} ) ;
113
123
} ) ;
124
+ it ( 'deserializes' , async function ( ) {
125
+ const serializedState = { children : [ 'IPY_MODEL_widgetChild2' ] } ;
126
+ const state = await (
127
+ this . widgetContainer . constructor as typeof WidgetModel
128
+ ) . _deserialize_state ( serializedState , this . manager ) ;
129
+ await this . widgetContainer . set_state ( state ) ;
130
+ expect ( this . widgetContainer . get ( 'children' ) ) . to . deep . equal ( [
131
+ this . widgetChild2 ,
132
+ ] ) ;
133
+ } ) ;
114
134
} ) ;
115
135
116
136
describe ( 'WidgetModel' , function ( ) {
0 commit comments