2019-06-04 10:43:06 +02:00
|
|
|
var expect = require("chai").expect;
|
2017-03-26 16:19:45 -03:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Functions into modules/default/newsfeed/newsfeed.js", function () {
|
2019-06-04 10:19:25 +02:00
|
|
|
Module = {};
|
2017-03-26 16:19:45 -03:00
|
|
|
Module.definitions = {};
|
|
|
|
Module.register = function (name, moduleDefinition) {
|
|
|
|
Module.definitions[name] = moduleDefinition;
|
|
|
|
};
|
|
|
|
|
|
|
|
// load newsfeed.js
|
|
|
|
require("../../../modules/default/newsfeed/newsfeed.js");
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("capitalizeFirstLetter", function () {
|
2020-05-05 14:54:49 +02:00
|
|
|
const words = {
|
2020-05-11 22:22:32 +02:00
|
|
|
rodrigo: "Rodrigo",
|
2017-07-20 00:27:57 -04:00
|
|
|
"123m": "123m",
|
|
|
|
"magic mirror": "Magic mirror",
|
|
|
|
",a": ",a",
|
2020-05-11 22:22:32 +02:00
|
|
|
ñandú: "Ñandú",
|
2017-03-26 16:19:45 -03:00
|
|
|
".!": ".!"
|
|
|
|
};
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
Object.keys(words).forEach((word) => {
|
|
|
|
it(`for ${word} should return ${words[word]}`, function () {
|
2017-03-26 16:19:45 -03:00
|
|
|
expect(Module.definitions.newsfeed.capitalizeFirstLetter(word)).to.equal(words[word]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|