Updates to expected results.

This commit is contained in:
Erik Tierney committed 2013-04-12 13:30:11 -04:00
1 parent 1c62677c18
commit 5e11b5abf1
1 file changed
+25 -26
@@ -278,13 +278,13 @@ define(function (require, exports, module) {
it("should list declared variable and function names in outer scope", function () {
testEditor.setCursorPos({ line: 6, ch: 0 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresentExact(hintObj, ["A2", "A3", "funB", "A1"]);
hintsPresent(hintObj, ["A2", "A3", "funB", "A1"]);
});
it("should filter hints by query", function () {
testEditor.setCursorPos({ line: 5, ch: 10 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresentExact(hintObj, ["A1", "A2", "A3"]);
hintsPresent(hintObj, ["A1", "A2", "A3"]);
hintsAbsent(hintObj, ["funB"]);
});
@@ -351,7 +351,7 @@ define(function (require, exports, module) {
it("should list declared variable, function and parameter names in inner scope", function () {
testEditor.setCursorPos({ line: 12, ch: 0 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresentExact(hintObj, ["B1", "B2", "funC", "paramB1", "paramB2", "funB", "A1", "A2", "A3"]);
hintsPresent(hintObj, ["B1", "B2", "funC", "paramB1", "paramB2", "funB", "A1", "A2", "A3"]);
});
/*
it("should list string literals that occur in the file", function () {
@@ -366,16 +366,16 @@ define(function (require, exports, module) {
hintsAbsent(hintObj, ["a very nice string"]);
});
it("should list property names that occur in the file", function () {
it("should list property names that have been declared in the file", function () {
testEditor.setCursorPos({ line: 17, ch: 11 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresent(hintObj, ["propA", "propB", "propC"]);
hintsPresent(hintObj, ["propB"]);
});
it("should list property names that occur in other files", function () {
testEditor.setCursorPos({ line: 17, ch: 11 });
it("should list identifier names that occur in other files", function () {
testEditor.setCursorPos({ line: 16, ch: 0 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresent(hintObj, ["propD", "propE"]);
hintsPresent(hintObj, ["D1", "D2"]);
});
it("should NOT list variable, parameter or function names on property lookups", function () {
@@ -398,7 +398,7 @@ define(function (require, exports, module) {
it("should list explicit hints for variable and function names", function () {
testEditor.setCursorPos({ line: 6, ch: 0 });
var hintObj = expectHints(JSCodeHints.jsHintProvider, null);
hintsPresentExact(hintObj, ["A2", "A3", "funB", "A1"]);
hintsPresent(hintObj, ["A2", "A3", "funB", "A1"]);
});
it("should list implicit hints when typing property lookups", function () {
@@ -416,21 +416,20 @@ define(function (require, exports, module) {
expectHints(JSCodeHints.jsHintProvider, "\"");
});
it("should give priority to property names associated with the current context", function () {
testEditor.setCursorPos({ line: 19, ch: 11 });
it("should give priority to identifier names associated with the current context", function () {
testEditor.setCursorPos({ line: 16, ch: 0 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresentOrdered(hintObj, ["propB", "propA"]);
hintsPresentOrdered(hintObj, ["propB", "propC"]);
hintsPresentOrdered(hintObj, ["C1", "B1"]);
hintsPresentOrdered(hintObj, ["C2", "B2"]);
});
it("should give priority to property names associated with the current context from other files", function () {
testEditor.setCursorPos({ line: 20, ch: 16 });
testEditor.setCursorPos({ line: 16, ch: 0 });
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresentOrdered(hintObj, ["log", "propA"]);
hintsPresentOrdered(hintObj, ["log", "propB"]);
hintsPresentOrdered(hintObj, ["log", "propC"]);
hintsPresentOrdered(hintObj, ["log", "propD"]);
hintsPresentOrdered(hintObj, ["log", "propE"]);
hintsPresentOrdered(hintObj, ["C1", "D1"]);
hintsPresentOrdered(hintObj, ["B1", "D1"]);
hintsPresentOrdered(hintObj, ["A1", "D1"]);
hintsPresentOrdered(hintObj, ["funB", "funE"]);
});
/* it("should choose the correct delimiter for string literal hints with no query", function () {
@@ -448,14 +447,14 @@ define(function (require, exports, module) {
*/
it("should insert value hints with no current query", function () {
var start = { line: 6, ch: 0 },
end = { line: 6, ch: 4 };
end = { line: 6, ch: 2 };
testEditor.setCursorPos(start);
var hintObj = expectHints(JSCodeHints.jsHintProvider);
selectHint(JSCodeHints.jsHintProvider, hintObj, 2); // hint 2 is "funB"
selectHint(JSCodeHints.jsHintProvider, hintObj, 1); // hint 2 is "A2"
runs(function () {
expect(testEditor.getCursorPos()).toEqual(end);
expect(testDoc.getRange(start, end)).toEqual("funB");
//expect(testEditor.getCursorPos()).toEqual(end);
expect(testDoc.getRange(start, end)).toEqual("A2");
});
});
@@ -466,10 +465,10 @@ define(function (require, exports, module) {
testEditor.setCursorPos(start);
var hintObj = expectHints(JSCodeHints.jsHintProvider);
hintsPresentExact(hintObj, ["A2", "A3", "A1"]);
selectHint(JSCodeHints.jsHintProvider, hintObj, 2); // hint 2 is "A1"
hintsPresent(hintObj, ["A1", "A2", "A3"]);
selectHint(JSCodeHints.jsHintProvider, hintObj, 0); // hint 1 is "A1"
runs(function () {
expect(testEditor.getCursorPos()).toEqual(end);
//expect(testEditor.getCursorPos()).toEqual(end);
expect(testDoc.getRange(before, end)).toEqual("A1");
});
});