@@ -25,27 +25,46 @@ describe('features/modeling - ModelingFeedback', function() {
2525 ]
2626 } ) ) ;
2727
28+ it ( 'should indicate error when placing flow elements inside collaboration' , inject (
29+ function ( create , canvas , elementFactory , dragging ) {
2830
29- it ( 'should indicate' , inject ( function ( create , canvas , elementFactory , dragging ) {
31+ // given
32+ var task = elementFactory . createShape ( { type : 'bpmn:Task' } ) ;
3033
31- // given
32- var task = elementFactory . createShape ( { type : 'bpmn:Task' } ) ;
34+ var collaboration = canvas . getRootElement ( ) ;
35+ var collaborationGfx = canvas . getGraphics ( collaboration ) ;
3336
34- var collaboration = canvas . getRootElement ( ) ;
35- var collaborationGfx = canvas . getGraphics ( collaboration ) ;
37+ create . start ( canvasEvent ( { x : 100 , y : 100 } ) , task ) ;
38+ dragging . hover ( { element : collaboration , gfx : collaborationGfx } ) ;
3639
37- create . start ( canvasEvent ( { x : 100 , y : 100 } ) , task ) ;
38- dragging . hover ( { element : collaboration , gfx : collaborationGfx } ) ;
40+ // when
41+ dragging . end ( ) ;
3942
40- // when
41- dragging . end ( ) ;
43+ // then
44+ expectTooltip ( 'error' , 'flow elements must be children of pools/participants' ) ;
45+ } ) ) ;
4246
43- // then
44- expectTooltip ( 'error' , 'flow elements must be children of pools/participants' ) ;
45- } ) ) ;
47+ it ( 'should indicate error when placing data objects inside collaboration' , inject (
48+ function ( create , canvas , elementFactory , dragging ) {
4649
47- } ) ;
50+ // given
51+ var dataObject = elementFactory . createShape ( { type : 'bpmn:DataObjectReference' } ) ;
52+
53+ var collaboration = canvas . getRootElement ( ) ;
54+ var collaborationGfx = canvas . getGraphics ( collaboration ) ;
55+
56+ create . start ( canvasEvent ( { x : 150 , y : 150 } ) , dataObject ) ;
57+ dragging . hover ( { element : collaboration , gfx : collaborationGfx } ) ;
4858
59+ // when
60+ dragging . end ( ) ;
61+
62+ // then
63+ expectTooltip ( 'error' , 'Data object must be placed within a pool/participant.' ) ;
64+ }
65+ ) ) ;
66+
67+ } ) ;
4968
5069function expectTooltip ( cls , message ) {
5170
0 commit comments