@@ -113,7 +113,7 @@ describe('Test graph class', () => {
113
113
expect ( Array . from ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . apis ) ) . toEqual ( [ 'API1' ] ) ;
114
114
expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . sources ) . toHaveProperty ( 'source1' ) ;
115
115
expect ( Array . from ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . publications ) ) . toEqual ( [ 'PMID:1' , 'PMID:2' ] ) ;
116
- expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . attributes ) . toHaveProperty ( 'relation' , new Set ( [ 'relation1' ] ) ) ;
116
+ expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . attributes ) . toHaveProperty ( 'relation' , [ 'relation1' ] ) ;
117
117
} ) ;
118
118
119
119
test ( 'Multiple query results are correctly updated for two edges having same input, predicate and output' , ( ) => {
@@ -134,13 +134,13 @@ describe('Test graph class', () => {
134
134
expect ( Array . from ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . apis ) ) . toEqual ( [ 'API1' ] ) ;
135
135
expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . sources ) . toHaveProperty ( 'source1' ) ;
136
136
expect ( Array . from ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . publications ) ) . toEqual ( [ 'PMID:1' , 'PMID:2' ] ) ;
137
- expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . attributes ) . toHaveProperty ( 'relation' , new Set ( [ 'relation1' ] ) ) ;
137
+ expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . attributes ) . toHaveProperty ( 'relation' , [ 'relation1' ] ) ;
138
138
139
139
expect ( g . edges ) . toHaveProperty ( '6930dcb2e9363817e9f6e736829ce278' ) ;
140
140
expect ( Array . from ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . apis ) ) . toEqual ( [ 'API2' ] ) ;
141
141
expect ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . sources ) . toHaveProperty ( 'source2' ) ;
142
142
expect ( Array . from ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . publications ) ) . toEqual ( [ 'PMC:1' , 'PMC:2' ] ) ;
143
- expect ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . attributes ) . toHaveProperty ( 'relation' , new Set ( [ 'relation2' ] ) ) ;
143
+ expect ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . attributes ) . toHaveProperty ( 'relation' , [ 'relation2' ] ) ;
144
144
} ) ;
145
145
146
146
test ( 'Multiple query results for different edges are correctly updated' , ( ) => {
@@ -161,19 +161,19 @@ describe('Test graph class', () => {
161
161
expect ( Array . from ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . apis ) ) . toEqual ( [ 'API1' ] ) ;
162
162
expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . sources ) . toHaveProperty ( 'source1' ) ;
163
163
expect ( Array . from ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . publications ) ) . toEqual ( [ 'PMID:1' , 'PMID:2' ] ) ;
164
- expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . attributes ) . toHaveProperty ( 'relation' , new Set ( [ 'relation1' ] ) ) ;
164
+ expect ( g . edges [ '3eb29a4cead0e5f3c3bdca4997bf215b' ] . attributes ) . toHaveProperty ( 'relation' , [ 'relation1' ] ) ;
165
165
166
166
expect ( g . edges ) . toHaveProperty ( '6930dcb2e9363817e9f6e736829ce278' ) ;
167
167
expect ( Array . from ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . apis ) ) . toEqual ( [ 'API2' ] ) ;
168
168
expect ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . sources ) . toHaveProperty ( 'source2' ) ;
169
169
expect ( Array . from ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . publications ) ) . toEqual ( [ 'PMC:1' , 'PMC:2' ] ) ;
170
- expect ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . attributes ) . toHaveProperty ( 'relation' , new Set ( [ 'relation2' ] ) ) ;
170
+ expect ( g . edges [ '6930dcb2e9363817e9f6e736829ce278' ] . attributes ) . toHaveProperty ( 'relation' , [ 'relation2' ] ) ;
171
171
172
172
expect ( g . edges ) . toHaveProperty ( '38e8cf1917452c83bb878c5a916ef86a' ) ;
173
173
expect ( Array . from ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . apis ) ) . toEqual ( [ 'API3' ] ) ;
174
174
expect ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . sources ) . toHaveProperty ( 'source3' ) ;
175
175
expect ( Array . from ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . publications ) ) . toEqual ( [ 'PMC:3' , 'PMC:4' ] ) ;
176
- expect ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . attributes ) . toHaveProperty ( 'relation' , new Set ( [ 'relation3' ] ) ) ;
176
+ expect ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . attributes ) . toHaveProperty ( 'relation' , [ 'relation3' ] ) ;
177
177
} ) ;
178
178
179
179
test ( 'Multiple attributes with the same name are merged' , ( ) => {
@@ -187,9 +187,10 @@ describe('Test graph class', () => {
187
187
'PMC:6' ,
188
188
'PMC:7' ,
189
189
] ) ;
190
- expect ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . attributes ) . toHaveProperty (
191
- 'relation' ,
192
- new Set ( [ 'relation3' , 'relation3a' , 'relation3b' ] ) ,
193
- ) ;
190
+ expect ( g . edges [ '38e8cf1917452c83bb878c5a916ef86a' ] . attributes ) . toHaveProperty ( 'relation' , [
191
+ 'relation3' ,
192
+ 'relation3a' ,
193
+ 'relation3b' ,
194
+ ] ) ;
194
195
} ) ;
195
196
} ) ;
0 commit comments