mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
cleaned up function and added test in case no file should be loaded
This commit is contained in:
@@ -106,6 +106,24 @@ describe("Translations", function () {
|
||||
done();
|
||||
};
|
||||
});
|
||||
|
||||
it("should load no file", (done) => {
|
||||
dom.window.onload = async function () {
|
||||
const { Translator, Module } = dom.window;
|
||||
Translator.load = sinon.stub();
|
||||
|
||||
Module.register("name", {});
|
||||
const MMM = Module.create("name");
|
||||
|
||||
const loaded = sinon.stub();
|
||||
MMM.loadTranslations(loaded);
|
||||
|
||||
expect(loaded.callCount).to.equal(1);
|
||||
expect(Translator.load.callCount).to.equal(0);
|
||||
|
||||
done();
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
const mmm = {
|
||||
|
Reference in New Issue
Block a user