A real test for https://bugs.edge.launchpad.net/bookreader/+bug/517424
authorMichael Ang <testflip@home.us.archive.org>
Fri, 12 Feb 2010 03:09:31 +0000 (03:09 +0000)
committerMichael Ang <testflip@home.us.archive.org>
Fri, 12 Feb 2010 03:09:31 +0000 (03:09 +0000)
BookReaderIA/test/unit/JSLocate.js

index 1169e99..8f9bc3d 100644 (file)
@@ -1,18 +1,29 @@
 // Tests for BookReaderJSLocate.php
 
+// $$$ TODO -- make the test host configurable/automagic
+
 module("JSLocate");
 
 test("first test within module", function() {
   ok( true, "all pass" );
 });
 
-test("second test within module", function() {
-  ok( true, "all pass" );
-});
 
-test("some other test", function() {
-  expect(2);
-  equals( true, true, "easy test" );
-  equals( true, true, "passing test" );
+// Set up dummy BookReader class for JSLocate
+function BookReader() {
+};
+
+BookReader.prototype.init = function() {
+    return true;
+};
+
+asyncTest("JSLocate for notesonsubmarine00grea", function() {
+    expect(1);
+    $.getScript('http://www-testflip.archive.org/bookreader/BookReaderJSLocate.php?id=amonographonmec00buregoog',
+        function(data, textStatus) {
+            equals(13, window.br.titleLeaf, 'br object should exist with title leaf 13. See https://bugs.launchpad.net/bookreader/+bug/517424');
+            start();
+        }
+    );
 });