@@ -90,17 +90,21 @@ describe('Data Modeling store', function () {
90
90
expect ( initialDiagram . connectionId ) . to . equal ( newDiagram . connectionId ) ;
91
91
expect ( initialDiagram . edits ) . to . have . length ( 1 ) ;
92
92
expect ( initialDiagram . edits [ 0 ] . type ) . to . equal ( 'SetModel' ) ;
93
- expect ( initialDiagram . edits [ 0 ] . model . collections [ 0 ] ) . to . deep . include ( {
93
+ const initialEdit = initialDiagram . edits [ 0 ] as Extract <
94
+ Edit ,
95
+ { type : 'SetModel' }
96
+ > ;
97
+ expect ( initialEdit . model . collections [ 0 ] ) . to . deep . include ( {
94
98
ns : newDiagram . collections [ 0 ] . ns ,
95
99
jsonSchema : newDiagram . collections [ 0 ] . schema ,
96
100
displayPosition : [ - 1 , - 1 ] ,
97
101
} ) ;
98
- expect ( initialDiagram . edits [ 0 ] . model . collections [ 1 ] ) . to . deep . include ( {
102
+ expect ( initialEdit . model . collections [ 1 ] ) . to . deep . include ( {
99
103
ns : newDiagram . collections [ 1 ] . ns ,
100
104
jsonSchema : newDiagram . collections [ 1 ] . schema ,
101
105
displayPosition : [ - 1 , - 1 ] ,
102
106
} ) ;
103
- expect ( initialDiagram . edits [ 0 ] . model . relationships ) . to . deep . equal (
107
+ expect ( initialEdit . model . relationships ) . to . deep . equal (
104
108
newDiagram . relations
105
109
) ;
106
110
@@ -116,17 +120,21 @@ describe('Data Modeling store', function () {
116
120
expect ( diagramWithLayout . connectionId ) . to . equal ( newDiagram . connectionId ) ;
117
121
expect ( diagramWithLayout . edits ) . to . have . length ( 1 ) ;
118
122
expect ( diagramWithLayout . edits [ 0 ] . type ) . to . equal ( 'SetModel' ) ;
119
- expect ( diagramWithLayout . edits [ 0 ] . model . collections [ 0 ] ) . to . deep . include ( {
123
+ const initialEditWithPositions = diagramWithLayout . edits [ 0 ] as Extract <
124
+ Edit ,
125
+ { type : 'SetModel' }
126
+ > ;
127
+ expect ( initialEditWithPositions . model . collections [ 0 ] ) . to . deep . include ( {
120
128
ns : newDiagram . collections [ 0 ] . ns ,
121
129
jsonSchema : newDiagram . collections [ 0 ] . schema ,
122
130
displayPosition : positions [ newDiagram . collections [ 0 ] . ns ] ,
123
131
} ) ;
124
- expect ( diagramWithLayout . edits [ 0 ] . model . collections [ 1 ] ) . to . deep . include ( {
132
+ expect ( initialEditWithPositions . model . collections [ 1 ] ) . to . deep . include ( {
125
133
ns : newDiagram . collections [ 1 ] . ns ,
126
134
jsonSchema : newDiagram . collections [ 1 ] . schema ,
127
135
displayPosition : positions [ newDiagram . collections [ 1 ] . ns ] ,
128
136
} ) ;
129
- expect ( diagramWithLayout . edits [ 0 ] . model . relationships ) . to . deep . equal (
137
+ expect ( initialEditWithPositions . model . relationships ) . to . deep . equal (
130
138
newDiagram . relations
131
139
) ;
132
140
} ) ;
0 commit comments