Tests: verify invalid string log messages

This commit is contained in:
Chris Adams 2013-07-02 15:20:17 -04:00
parent 7131c7a7da
commit 2a3044e0cf

View File

@ -1,6 +1,12 @@
/* global module, asyncTest, $, ok, equal, notEqual, start, test, Util, testLog */
(function() { (function() {
module("strings"); module("strings", {
setup: function () {
testLog.reset();
}
});
test("getSubString", function() { test("getSubString", function() {
equal(OpenSeadragon.getString("Errors.Dzi"), equal(OpenSeadragon.getString("Errors.Dzi"),
@ -15,10 +21,13 @@
}); });
test("getInvalidString", function() { test("getInvalidString", function() {
equal(OpenSeadragon.getString("Greeting"), "", equal(OpenSeadragon.getString("Greeting"), "", "Handled unset string key");
"Handled unset string key"); ok(testLog.debug.contains('["Untranslated source string:","Greeting"]'),
equal(OpenSeadragon.getString("Errors"), "", 'Invalid string keys are logged');
"Handled requesting parent key");
equal(OpenSeadragon.getString("Errors"), "", "Handled requesting parent key");
ok(testLog.debug.contains('["Untranslated source string:","Errors"]'),
'Invalid string parent keys are logged');
}); });
test("setString", function() { test("setString", function() {