2022-10-07 19:16:37 +02:00
|
|
|
const helpers = require("./helpers/global-setup");
|
2017-03-18 12:40:07 -03:00
|
|
|
|
2022-10-04 10:15:24 +02:00
|
|
|
describe("Vendors", () => {
|
2022-10-29 22:34:17 +02:00
|
|
|
beforeAll(async () => {
|
|
|
|
await helpers.startApplication("tests/configs/default.js");
|
2017-03-18 12:40:07 -03:00
|
|
|
});
|
2022-10-04 10:15:24 +02:00
|
|
|
afterAll(async () => {
|
2022-05-27 19:46:28 +02:00
|
|
|
await helpers.stopApplication();
|
2017-03-18 12:40:07 -03:00
|
|
|
});
|
|
|
|
|
2022-10-04 10:15:24 +02:00
|
|
|
describe("Get list vendors", () => {
|
2023-03-19 14:32:23 +01:00
|
|
|
const vendors = require(`${__dirname}/../../vendor/vendor.js`);
|
2021-06-30 15:22:24 +02:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
Object.keys(vendors).forEach((vendor) => {
|
2022-10-04 10:15:24 +02:00
|
|
|
it(`should return 200 HTTP code for vendor "${vendor}"`, async () => {
|
2023-03-19 14:32:23 +01:00
|
|
|
const urlVendor = `http://localhost:8080/vendor/${vendors[vendor]}`;
|
2023-09-09 21:12:31 +02:00
|
|
|
const res = await fetch(urlVendor);
|
2022-10-04 10:15:24 +02:00
|
|
|
expect(res.status).toBe(200);
|
2017-03-18 12:40:07 -03:00
|
|
|
});
|
|
|
|
});
|
2017-04-18 23:44:50 -03:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
Object.keys(vendors).forEach((vendor) => {
|
2022-10-04 10:15:24 +02:00
|
|
|
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, async () => {
|
2023-03-19 14:32:23 +01:00
|
|
|
const urlVendor = `http://localhost:8080/${vendors[vendor]}`;
|
2023-09-09 21:12:31 +02:00
|
|
|
const res = await fetch(urlVendor);
|
2022-10-04 10:15:24 +02:00
|
|
|
expect(res.status).toBe(404);
|
2017-04-18 23:44:50 -03:00
|
|
|
});
|
|
|
|
});
|
2017-03-18 12:40:07 -03:00
|
|
|
});
|
|
|
|
});
|