Ticket #107: 107.patch
| File 107.patch, 2.3 kB (added by tschaub, 1 year ago) |
|---|
-
tests/lib/GeoExt/widgets/Popup.html
old new 11 11 12 12 function setupContext() { 13 13 14 var map = new OpenLayers.Map( );14 var map = new OpenLayers.Map({panMethod: null}); // avoid tween panning for tests 15 15 var layer = new OpenLayers.Layer("test", {isBaseLayer: true}); 16 16 map.addLayer(layer); 17 17 … … 70 70 pop.show(); 71 71 72 72 t.ok(Ext.getBody().child("div." + pop.popupCls),"viewport contains popup"); 73 73 74 74 tearDown(context); 75 75 } 76 76 77 77 function test_anchorPopup(t) { 78 t.plan(4); 78 79 // TODO: was t.plan(4), it looks to me like this was due to tweening 80 // if there really should only be one move, remove this comment 81 t.plan(2); 79 82 80 83 var context = setupContext(); 81 84 82 85 var pop = popup(context.feature); 83 86 84 87 pop.show(); 88 89 var moves = 0; 85 90 86 91 pop.on({ 87 92 'move' : function(c,x,y){ 88 t.ok(true,"Move event fired on " + action); //should happen twice, on call to position()93 ++moves; 89 94 }, 90 95 scope : this 91 96 }); … … 93 98 t.ok(pop.getAnchorElement(), "Popup has anchor element"); 94 99 95 100 var action = "map move"; 96 context.map.events.triggerEvent("move"); 101 context.map.setCenter(new OpenLayers.LonLat(6, 45)); 102 t.eq(moves, 1, "Move event fired on " + action); 97 103 104 105 // TODO: do we really expect any move events here? 106 // if not, these lines are irrelevant 98 107 action = "popup collapse"; 99 108 pop.collapse(); 100 109 110 // TODO: do we really expect any move events here? 111 // if not, these lines are irrelevant 101 112 action = "popup expand" 102 113 pop.expand(); 103 114 … … 113 124 var pop = popup(context.feature, context.mapPanel); 114 125 115 126 pop.show(); 116 127 117 128 pop.collapse(); 118 129 119 130 var origPos = pop.getPosition();