Commits

Shlomi Fish committed 2642637

[jqtree generation] Add another assertion + bug fix.

  • Participants
  • Parent commits 561d717
  • Branches convert-from-jquery-treeview-to-jqtree-plugin

Comments (0)

Files changed (1)

Tests/js/jqtree-from-h-w-json-nav-menu-test.js

 
     var count = (rel_path.match(/\//g)||[]).length;
 
+    if (rel_path.match(/[^\/]$/))
+    {
+        count++;
+    }
+
     return '../'.repeat(count);
 }
 
     module("NavMenu.Main.ToJQTree");
 
     test("NavMenu main test", function () {
-        expect(2);
+        expect(3);
 
         // TEST
         ok (true, "True is, well, true.");
             '../',
             "relative path 1"
         );
+
+        // TEST
+        equal (
+            get_base_relative_path(
+                {
+                    base: 'http://www.shlomifish.org/',
+                    current: 'http://www.shlomifish.org/humour.html',
+                }
+            ),
+            '../',
+            "relative path 2"
+        );
     });
 }