2017-07-24 22:08:12 +02:00
|
|
|
const helpers = require("./global-setup");
|
2017-03-18 12:40:07 -03:00
|
|
|
const request = require("request");
|
2017-07-24 22:08:12 +02:00
|
|
|
const expect = require("chai").expect;
|
2017-03-18 12:40:07 -03:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
const describe = global.describe;
|
|
|
|
const it = global.it;
|
2017-07-25 20:20:51 -04:00
|
|
|
const before = global.before;
|
|
|
|
const after = global.after;
|
2017-03-18 12:40:07 -03:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
describe("Vendors", function () {
|
2017-08-05 02:39:37 -04:00
|
|
|
|
|
|
|
return; // Test still getting failed in Travis
|
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
helpers.setupTimeout(this);
|
2017-03-18 12:40:07 -03:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
var app = null;
|
2017-07-20 00:25:10 -04:00
|
|
|
|
2017-07-25 20:20:51 -04:00
|
|
|
before(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers.startApplication({
|
|
|
|
args: ["js/electron.js"]
|
|
|
|
}).then(function (startedApp) { app = startedApp; })
|
2017-03-18 12:40:07 -03:00
|
|
|
});
|
|
|
|
|
2017-07-25 20:20:51 -04:00
|
|
|
after(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers.stopApplication(app);
|
2017-03-18 12:40:07 -03:00
|
|
|
});
|
|
|
|
|
|
|
|
describe("Get list vendors", function () {
|
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
before(function () {
|
2017-03-18 12:40:07 -03:00
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
|
|
|
|
});
|
|
|
|
|
|
|
|
var vendors = require(__dirname + "/../../vendor/vendor.js");
|
|
|
|
Object.keys(vendors).forEach(vendor => {
|
2017-07-24 22:08:12 +02:00
|
|
|
it(`should return 200 HTTP code for vendor "${vendor}"`, function () {
|
2017-03-18 12:40:07 -03:00
|
|
|
urlVendor = "http://localhost:8080/vendor/" + vendors[vendor];
|
|
|
|
request.get(urlVendor, function (err, res, body) {
|
|
|
|
expect(res.statusCode).to.equal(200);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|