File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 11import render from '../../src/render' ;
22import mockViewport from '../mockViewport' ;
33import { equal } from 'assert' ;
4+ import uuid from "../../src/utils/uuid"
45
56function _render ( annotations ) {
67 let data = Array . isArray ( annotations ) ? { annotations } : annotations ;
@@ -16,29 +17,40 @@ describe('render::index', function () {
1617 viewport = mockViewport ( ) ;
1718 } ) ;
1819
19- it ( 'should reset SVG on each render ' , function ( ) {
20+ it ( 'should not render the same annotation multiple times ' , function ( ) {
2021 let viewport = mockViewport ( undefined , undefined , .5 ) ;
22+ let id1 = uuid ( ) ;
23+ let id2 = uuid ( ) ;
2124
2225 _render ( [
2326 {
24- type : 'point ' ,
27+ type : 'area ' ,
2528 x : 0 ,
26- y : 0
29+ y : 0 ,
30+ width : 10 ,
31+ height : 10 ,
32+ uuid : id1
2733 }
2834 ] ) ;
2935
3036 equal ( svg . children . length , 1 ) ;
3137
3238 _render ( [
3339 {
34- type : 'point ' ,
40+ type : 'area ' ,
3541 x : 0 ,
36- y : 0
42+ y : 0 ,
43+ width : 10 ,
44+ height : 10 ,
45+ uuid : id1
3746 } ,
3847 {
39- type : 'point ' ,
48+ type : 'area ' ,
4049 x : 25 ,
41- y : 25
50+ y : 25 ,
51+ width : 10 ,
52+ height : 10 ,
53+ uuid : id2
4254 }
4355 ] ) ;
4456
You can’t perform that action at this time.
0 commit comments