~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/openlayers/tests/Popup/Anchored.html

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
  <script src="../../lib/OpenLayers.js"></script>
 
4
  <script type="text/javascript">
 
5
 
 
6
    var popup;
 
7
 
 
8
    function test_Popup_Anchored_default_constructor(t) {
 
9
        t.plan( 4 );
 
10
 
 
11
        popup = new OpenLayers.Popup.Anchored();
 
12
 
 
13
        t.ok( popup instanceof OpenLayers.Popup.Anchored, "new OpenLayers.Popup.Anchored returns Popup.Anchored object" );
 
14
        t.ok(popup.id.startsWith("OpenLayers.Popup.Anchored"), "valid default popupid");
 
15
        var firstID = popup.id;
 
16
        t.eq(popup.contentHTML, null, "good default popup.contentHTML");
 
17
 
 
18
        
 
19
        popup = new OpenLayers.Popup.Anchored();
 
20
        var newID = popup.id;
 
21
        t.ok(newID != firstID, "default id generator creating unique ids");
 
22
    }
 
23
    function test_Popup_Anchored_updateRelPos(t) { 
 
24
        t.plan(1);
 
25
        var popup = new OpenLayers.Popup.Anchored();
 
26
        popup.calculateNewPx = function () {}
 
27
        popup.calculateRelativePosition = function() {
 
28
            t.ok(true, "update relative position is called on moveTo");
 
29
        }
 
30
        popup.moveTo(new OpenLayers.Pixel(0,0));
 
31
   } 
 
32
 
 
33
  </script>
 
34
</head>
 
35
<body>
 
36
</body>
 
37
</html>