diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 3db09492..18f471c2 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -332,17 +332,6 @@ Module.register("newsfeed", { }, 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 () { this.isShowingDescription = this.config.showDescription; this.config.showFullArticle = false; diff --git a/tests/unit/functions/newsfeed_spec.js b/tests/unit/functions/newsfeed_spec.js index 94c4c3b9..b66bfe32 100644 --- a/tests/unit/functions/newsfeed_spec.js +++ b/tests/unit/functions/newsfeed_spec.js @@ -1,29 +1,15 @@ var expect = require("chai").expect; describe("Functions into modules/default/newsfeed/newsfeed.js", function () { + // Fake for use by newsletter.js Module = {}; Module.definitions = {}; Module.register = function (name, moduleDefinition) { Module.definitions[name] = moduleDefinition; }; - // 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]); - }); - }); + before(function () { + // load newsfeed.js + require("../../../modules/default/newsfeed/newsfeed.js"); }); });