mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 13:09:34 +00:00
Remove unused helper function and its unit test
This commit is contained in:
parent
d00da790af
commit
8dc88fe64b
@ -332,17 +332,6 @@ Module.register("newsfeed", {
|
|||||||
}, this.config.updateInterval);
|
}, this.config.updateInterval);
|
||||||
},
|
},
|
||||||
|
|
||||||
/* capitalizeFirstLetter(string)
|
|
||||||
* Capitalizes the first character of a string.
|
|
||||||
*
|
|
||||||
* argument string string - Input string.
|
|
||||||
*
|
|
||||||
* return string - Capitalized output string.
|
|
||||||
*/
|
|
||||||
capitalizeFirstLetter: function (string) {
|
|
||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
||||||
},
|
|
||||||
|
|
||||||
resetDescrOrFullArticleAndTimer: function () {
|
resetDescrOrFullArticleAndTimer: function () {
|
||||||
this.isShowingDescription = this.config.showDescription;
|
this.isShowingDescription = this.config.showDescription;
|
||||||
this.config.showFullArticle = false;
|
this.config.showFullArticle = false;
|
||||||
|
@ -1,29 +1,15 @@
|
|||||||
var expect = require("chai").expect;
|
var expect = require("chai").expect;
|
||||||
|
|
||||||
describe("Functions into modules/default/newsfeed/newsfeed.js", function () {
|
describe("Functions into modules/default/newsfeed/newsfeed.js", function () {
|
||||||
|
// Fake for use by newsletter.js
|
||||||
Module = {};
|
Module = {};
|
||||||
Module.definitions = {};
|
Module.definitions = {};
|
||||||
Module.register = function (name, moduleDefinition) {
|
Module.register = function (name, moduleDefinition) {
|
||||||
Module.definitions[name] = moduleDefinition;
|
Module.definitions[name] = moduleDefinition;
|
||||||
};
|
};
|
||||||
|
|
||||||
// load newsfeed.js
|
before(function () {
|
||||||
require("../../../modules/default/newsfeed/newsfeed.js");
|
// load newsfeed.js
|
||||||
|
require("../../../modules/default/newsfeed/newsfeed.js");
|
||||||
describe("capitalizeFirstLetter", function () {
|
|
||||||
const words = {
|
|
||||||
rodrigo: "Rodrigo",
|
|
||||||
"123m": "123m",
|
|
||||||
"magic mirror": "Magic mirror",
|
|
||||||
",a": ",a",
|
|
||||||
ñandú: "Ñandú",
|
|
||||||
".!": ".!"
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.keys(words).forEach((word) => {
|
|
||||||
it(`for ${word} should return ${words[word]}`, function () {
|
|
||||||
expect(Module.definitions.newsfeed.capitalizeFirstLetter(word)).to.equal(words[word]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user