Skip to content
Snippets Groups Projects
Commit 36e12d51 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Update tests

parent b85971ad
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,7 @@ distributionApp.get('/', rqf.parse(), (req, res, next) => {
let result = [];
let first = true;
req.enrollmentFactor.forEach((city) => {
if(first) console.log(city);
// if(first) console.log(city);
let obj = {
level: city.nivel,
region_id: city.regiao_id,
......@@ -172,7 +172,7 @@ distributionApp.get('/', rqf.parse(), (req, res, next) => {
city_name: city.city_name,
series: []
};
if(first) console.log(obj);
// if(first) console.log(obj);
first = false;
relation.forEach((serie) => {
obj.series.push({
......
......@@ -241,8 +241,8 @@ function matchQueries(queryTotal, queryPartial) {
keys.forEach((key) => {
newObj[key] = result[key];
});
console.log('NEW OBJ');
console.log(newObj);
// console.log('NEW OBJ');
// console.log(newObj);
let index = keys.indexOf('total');
if(index > -1) keys.splice(index, 1);
let objMatch = null;
......@@ -264,7 +264,7 @@ function matchQueries(queryTotal, queryPartial) {
}
if(objMatch) {
console.log(objMatch);
// console.log(objMatch);
newObj.denominator = result.total;
newObj.partial = objMatch.total;
newObj.total = (objMatch.total / result.total) * 100;
......
......@@ -23,7 +23,7 @@ const libs = `${process.cwd()}/libs`;
const server = require(`${libs}/app`);
chai.use(chaiHttp);
describe('request idhme', () => {
describe('request infrastructure', () => {
it('should list default query infrastructure', (done) => {
chai.request(server)
.get('/api/v1/infrastructure')
......@@ -63,9 +63,9 @@ describe('request idhme', () => {
});
});
it('should list the locations detailed', (done) => {
it('should list the rural locations', (done) => {
chai.request(server)
.get('/api/v1/infrastructure/location_detailed')
.get('/api/v1/infrastructure/rural_location')
.end((err, res) => {
res.should.have.status(200);
res.should.be.json;
......
......@@ -67,21 +67,6 @@ describe('request siope', () => {
});
});
it('should list siope with valid filters', (done) => {
chai.request(server)
.get('/api/v1/siope?filter=max_year:2013')
.end((err, res) => {
res.should.have.status(200);
res.should.be.json;
res.body.should.have.property('result');
res.body.result.should.be.a('array');
res.body.result[0].should.have.property('year');
res.body.result[0].should.have.property('state_id');
res.body.result[0].should.have.property('fundeb');
done();
});
});
it('should list siope with valid dimensions', (done) => {
chai.request(server)
.get('/api/v1/siope?dims=state')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment