Merge pull request #837 from roramirez/tests-vendors

Tests vendors
This commit is contained in:
Michael Teeuw 2017-04-11 10:45:47 +02:00 committed by GitHub
commit eae21e1371
3 changed files with 39 additions and 0 deletions

View File

@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option. - Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option.
- Add test e2e `show title newsfeed` for newsfeed module. - Add test e2e `show title newsfeed` for newsfeed module.
- Add task to check configuration file. - Add task to check configuration file.
- Add test check URLs of vendors.
### Updated ### Updated
- Added missing keys to Polish translation. - Added missing keys to Polish translation.

36
tests/e2e/vendor_spec.js Normal file
View File

@ -0,0 +1,36 @@
const globalSetup = require("./global-setup");
const app = globalSetup.app;
const request = require("request");
const chai = require("chai");
const expect = chai.expect;
describe("Vendors", function () {
this.timeout(20000);
beforeEach(function (done) {
app.start().then(function() { done(); } );
});
afterEach(function (done) {
app.stop().then(function() { done(); });
});
describe("Get list vendors", function () {
before(function() {
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
});
var vendors = require(__dirname + "/../../vendor/vendor.js");
Object.keys(vendors).forEach(vendor => {
it(`should return 200 HTTP code for vendor "${vendor}"`, function() {
urlVendor = "http://localhost:8080/vendor/" + vendors[vendor];
request.get(urlVendor, function (err, res, body) {
expect(res.statusCode).to.equal(200);
});
});
});
});
});

2
vendor/vendor.js vendored
View File

@ -14,3 +14,5 @@ var vendor = {
"weather-icons-wind.css": "node_modules/weathericons/css/weather-icons-wind.css", "weather-icons-wind.css": "node_modules/weathericons/css/weather-icons-wind.css",
"font-awesome.css": "node_modules/font-awesome/css/font-awesome.min.css" "font-awesome.css": "node_modules/font-awesome/css/font-awesome.min.css"
}; };
if (typeof module !== "undefined"){module.exports = vendor;}