UNPKG

dojox

Version:

Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.

59 lines (51 loc) 1.6 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>doh.robot Editor Smiley Plugin Test</title> <style> @import "../../../../util/doh/robot/robot.css"; </style> <!-- required: dojo.js --> <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true"></script> <script type="text/javascript"> dojo.require("dijit.robotx"); dojo.require("dijit.tests.helpers"); // functions to help test dojo.addOnLoad(function(){ doh.robot.initRobot('../editorSmileyPlugin.html'); var editor; var value; doh.register("SmileyPlugin_tests", [ { // name: "Smiley preFilter test", timeout: 20000, setUp: function(){ editor = dijit.byId("editor"); value = editor.attr("value"); }, runTest: function(){ var d = new doh.Deferred(); try{ doh.robot.sequence(d.getTestCallback(function(){ // // check smiley icon count var nodes = dojo.query("img ", editor.editNode); doh.assertEqual(20, nodes.length, editor.editNode.innerHTML); }), 1000); }catch(e){ d.errback(e); } return d; }, tearDown: function(){ if(editor){editor.attr("value", value);} } } ]); doh.run(); }); </script> </head> </html>