From 7918448be267f62f3ef8358a05eb88ac216bf822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Sat, 18 Mar 2017 12:40:07 -0300 Subject: [PATCH 1/2] Add test for vendor This test get all vendor defined. Create a get request http each vendor and expect the 200 HTTP code. --- tests/e2e/vendor_spec.js | 36 ++++++++++++++++++++++++++++++++++++ vendor/vendor.js | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 tests/e2e/vendor_spec.js diff --git a/tests/e2e/vendor_spec.js b/tests/e2e/vendor_spec.js new file mode 100644 index 00000000..39abf906 --- /dev/null +++ b/tests/e2e/vendor_spec.js @@ -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); + }); + }); + }); + }); +}); diff --git a/vendor/vendor.js b/vendor/vendor.js index 7076cc45..82535b7a 100644 --- a/vendor/vendor.js +++ b/vendor/vendor.js @@ -14,3 +14,5 @@ var vendor = { "weather-icons-wind.css": "node_modules/weathericons/css/weather-icons-wind.css", "font-awesome.css": "node_modules/font-awesome/css/font-awesome.min.css" }; + +if (typeof module !== "undefined"){module.exports = vendor;} From d68d4c2c76bad5e44f8d0dafa9ee456b582966d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 7 Apr 2017 10:08:42 -0300 Subject: [PATCH 2/2] Add Changelog vendor_spec --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22aa51ad..3ece1e37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 test e2e `show title newsfeed` for newsfeed module. - Add task to check configuration file. +- Add test check URLs of vendors. ### Updated - Added missing keys to Polish translation.