mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
add test for jscodehints.noHintsOnDot pref
This commit is contained in:
1 parent
06cae4c0d9
commit
550a9acb97
1 file changed
+22
@@ -34,6 +34,7 @@ define(function (require, exports, module) {
|
||||
EditorManager = brackets.getModule("editor/EditorManager"),
|
||||
FileSystem = brackets.getModule("filesystem/FileSystem"),
|
||||
FileUtils = brackets.getModule("file/FileUtils"),
|
||||
PreferencesManager = brackets.getModule("preferences/PreferencesManager"),
|
||||
SpecRunnerUtils = brackets.getModule("spec/SpecRunnerUtils"),
|
||||
UnitTestReporter = brackets.getModule("test/UnitTestReporter"),
|
||||
JSCodeHints = require("main"),
|
||||
@@ -1279,6 +1280,27 @@ define(function (require, exports, module) {
|
||||
});
|
||||
});
|
||||
|
||||
// Test `jscodehints.noHintsOnDot` preference
|
||||
it("should consider dot a hintable key based on preference", function () {
|
||||
var noHintsOnDot = PreferencesManager.get("jscodehints.noHintsOnDot");
|
||||
|
||||
testEditor.setCursorPos({ line: 44, ch: 10 });
|
||||
|
||||
// Default is falsey
|
||||
expect(noHintsOnDot).toBeFalsy();
|
||||
|
||||
// Should get hints after dot
|
||||
expectHints(JSCodeHints.jsHintProvider, ".");
|
||||
|
||||
// Set preference to true
|
||||
PreferencesManager.set("jscodehints.noHintsOnDot", true);
|
||||
|
||||
// Should no longer get hints after dot
|
||||
expectNoHints(JSCodeHints.jsHintProvider, ".");
|
||||
|
||||
// Set preference back to original value (converted to boolean)
|
||||
PreferencesManager.set("jscodehints.noHintsOnDot", !!noHintsOnDot);
|
||||
});
|
||||
});
|
||||
|
||||
describe("JavaScript Code Hinting in a HTML file", function () {
|
||||
|
||||
Reference in new issue
Block a user