Permalink
Browse files

Merge pull request #2324 from adobe/pflynn/find-unit-tests

Unit tests for Find
  • Loading branch information...
2 parents 0164820 + 74712d9 commit ebc18c9a8ad9bfd9a6137f4f43bd29e49a4d8620 @gruehle gruehle committed Dec 11, 2012
View
@@ -77,7 +77,7 @@
<script src="thirdparty/jquery-1.7.min.js"></script>
<script src="thirdparty/CodeMirror2/lib/codemirror.js"></script>
- <!-- JS for CodeMirror search support, currently for debugging only -->
+ <!-- JS for CodeMirror search support -->
<script src="thirdparty/CodeMirror2/lib/util/dialog.js"></script>
<script src="thirdparty/CodeMirror2/lib/util/searchcursor.js"></script>
<script src="thirdparty/CodeMirror2/lib/util/search.js"></script>
View
@@ -36,6 +36,8 @@
<!-- Pre-load third party scripts that cannot be async loaded. -->
<script src="../src/thirdparty/jquery-1.7.min.js"></script>
<script src="../src/thirdparty/CodeMirror2/lib/codemirror.js"></script>
+ <script src="../src/thirdparty/CodeMirror2/lib/util/dialog.js"></script>
+ <script src="../src/thirdparty/CodeMirror2/lib/util/searchcursor.js"></script>
<script src="../src/thirdparty/mustache/mustache.js"></script>
<script src="thirdparty/bootstrap2/js/bootstrap.min.js"></script>
View
@@ -37,6 +37,7 @@ define(function (require, exports, module) {
require("spec/EditorCommandHandlers-test");
require("spec/ExtensionUtils-test");
require("spec/FileIndexManager-test");
+ require("spec/FindReplace-test");
require("spec/InlineEditorProviders-test");
require("spec/KeyBindingManager-test");
require("spec/LiveDevelopment-test");
@@ -104,7 +104,7 @@ define(function (require, exports, module) {
// simulate Ctrl+space keystroke to invoke code hints menu
runs(function () {
var e = $.Event("keydown");
- e.keyCode = KeyEvent.DOM_VK_SPACE; // spacebar key
+ e.keyCode = KeyEvent.DOM_VK_SPACE;
e.ctrlKey = true;
editor = EditorManager.getCurrentFullEditor();
@@ -125,7 +125,7 @@ define(function (require, exports, module) {
// simulate Enter key to insert code hint into doc
runs(function () {
var e = $.Event("keydown");
- e.keyCode = 13; // Enter/return key
+ e.keyCode = KeyEvent.DOM_VK_RETURN;
editor = EditorManager.getCurrentFullEditor();
expect(editor).toBeTruthy();
@@ -150,7 +150,7 @@ define(function (require, exports, module) {
// simulate Ctrl+space keystroke to invoke code hints menu
runs(function () {
var e = $.Event("keydown");
- e.keyCode = 32; // spacebar key
+ e.keyCode = KeyEvent.DOM_VK_SPACE;
e.ctrlKey = true;
editor = EditorManager.getCurrentFullEditor();
@@ -168,7 +168,7 @@ define(function (require, exports, module) {
// simulate Esc key to dismiss code hints menu
runs(function () {
- var key = 27, // Esc key
+ var key = KeyEvent.DOM_VK_ESCAPE,
element = testWindow.$(".dropdown.open")[0];
SpecRunnerUtils.simulateKeyEvent(key, "keydown", element);
@@ -29,11 +29,9 @@ define(function (require, exports, module) {
var Editor = require("editor/Editor").Editor,
EditorCommandHandlers = require("editor/EditorCommandHandlers"),
- EditorManager = require("editor/EditorManager"),
Commands = require("command/Commands"),
CommandManager = require("command/CommandManager"),
- SpecRunnerUtils = require("spec/SpecRunnerUtils"),
- EditorUtils = require("editor/EditorUtils");
+ SpecRunnerUtils = require("spec/SpecRunnerUtils");
describe("EditorCommandHandlers", function () {
Oops, something went wrong.

0 comments on commit ebc18c9

Please sign in to comment.