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() {
module("strings");
module("strings", {
setup: function () {
testLog.reset();
}
});
test("getSubString", function() {
equal(OpenSeadragon.getString("Errors.Dzi"),
@ -15,10 +21,13 @@
});
test("getInvalidString", function() {
equal(OpenSeadragon.getString("Greeting"), "",
"Handled unset string key");
equal(OpenSeadragon.getString("Errors"), "",
"Handled requesting parent key");
equal(OpenSeadragon.getString("Greeting"), "", "Handled unset string key");
ok(testLog.debug.contains('["Untranslated source string:","Greeting"]'),
'Invalid string keys are logged');
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() {