2007-09-06 10:25:06 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
|
|
|
|
<html id="html">
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
<title>Luminotes Editor Tests</title>
|
|
|
|
<script language="JavaScript" type="text/javascript" src="../../jsunit/app/jsUnitCore.js"></script>
|
|
|
|
<script language="JavaScript" type="text/javascript" src="../MochiKit.js"></script>
|
|
|
|
<script language="JavaScript" type="text/javascript" src="../Editor.js"></script>
|
|
|
|
<script language="JavaScript" type="text/javascript">
|
|
|
|
|
2007-09-07 21:39:01 +00:00
|
|
|
function setUpPage() {
|
2007-09-06 10:25:06 +00:00
|
|
|
id = "fake_id";
|
|
|
|
notebook_id = "fake_notebook_id";
|
2007-09-07 21:39:01 +00:00
|
|
|
title = "the title"
|
|
|
|
note_text = "<h3>" + title + "</h3>blah";
|
2007-09-06 10:25:06 +00:00
|
|
|
deleted_from = undefined;
|
|
|
|
revisions_list = undefined;
|
|
|
|
read_write = true;
|
|
|
|
startup = false;
|
|
|
|
highlight = false;
|
2007-09-06 20:18:08 +00:00
|
|
|
editor_focus = false;
|
2007-09-06 10:25:06 +00:00
|
|
|
|
2007-09-06 20:18:08 +00:00
|
|
|
editor = new Editor( id, notebook_id, note_text, deleted_from, revisions_list, read_write, startup, highlight, editor_focus );
|
2007-09-07 21:05:39 +00:00
|
|
|
|
|
|
|
init_complete = false;
|
|
|
|
connect( editor, "init_complete", function () { init_complete = true; } );
|
2007-09-06 10:25:06 +00:00
|
|
|
|
2007-09-07 21:39:01 +00:00
|
|
|
wait_for_init_complete();
|
2007-09-06 21:36:39 +00:00
|
|
|
}
|
|
|
|
|
2007-09-07 21:39:01 +00:00
|
|
|
function wait_for_init_complete() {
|
2007-09-07 21:05:39 +00:00
|
|
|
// busywait for the editor initialization to complete
|
|
|
|
if ( !init_complete ) {
|
2007-09-07 21:39:01 +00:00
|
|
|
setTimeout( "wait_for_init_complete()", 10 );
|
2007-09-07 21:05:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-09-07 21:39:01 +00:00
|
|
|
setUpPageStatus = "complete";
|
|
|
|
}
|
|
|
|
|
|
|
|
function tearDown() {
|
|
|
|
editor.shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_Editor() {
|
|
|
|
assertNotUndefined( "editor should have changes_button member", editor.changes_button );
|
|
|
|
assertNotUndefined( "editor should have options_button member", editor.options_button );
|
|
|
|
assertFalse( "editor should not have closed flag set", editor.closed );
|
|
|
|
assertEquals( "editor should have correct deleted_from flag", editor.deleted_from, deleted_from || null );
|
|
|
|
assertNotUndefined( "editor should have document member", editor.document );
|
|
|
|
assertNotUndefined( "document should have body member", editor.document.body );
|
|
|
|
assertEquals(
|
|
|
|
"document.body.innerHTML should start with note_text",
|
|
|
|
editor.document.body.innerHTML.toLowerCase().indexOf( note_text.toLowerCase() ), 0
|
|
|
|
);
|
|
|
|
assertEquals( "editor id should have correct id", editor.id, id );
|
|
|
|
assertNotUndefined( "editor should have iframe member", editor.iframe );
|
|
|
|
assertEquals( "editor should have empty revisions list", editor.revisions_list.length, 0 );
|
|
|
|
assertEquals( "editor should have correct startup flag", editor.startup, startup );
|
|
|
|
assertEquals( "editor should have correct title", editor.title, title );
|
|
|
|
assertEquals( "editor should have correct read_write flag", editor.read_write, read_write );
|
2007-09-06 10:25:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h1>Luminotes Editor Tests</h1>
|
|
|
|
|
|
|
|
<p>This page contains tests for the Luminotes Editor class. To see them, take a look at the source.</p>
|
|
|
|
|
|
|
|
<div id="notes"></div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|