@@ -84,6 +84,16 @@ describe('serialize/deserialize', function () {
8484 model_id : 'widgetChild' ,
8585 } ) ;
8686
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+
8797 this . widgetContainer = await this . manager . new_widget (
8898 {
8999 model_name : 'ContainerWidget' ,
@@ -111,6 +121,16 @@ describe('serialize/deserialize', function () {
111121 children : [ 'IPY_MODEL_widgetChild' ] ,
112122 } ) ;
113123 } ) ;
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+ } ) ;
114134} ) ;
115135
116136describe ( 'WidgetModel' , function ( ) {
0 commit comments