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

:white_check_mark: Add tests to /enrollment

parent 29110380
Branches
Tags
2 merge requests!116Release v1.0.0,!34Db simcaq dev2
Pipeline #
...@@ -75,7 +75,7 @@ gulp.task('pre-test', () => { ...@@ -75,7 +75,7 @@ gulp.task('pre-test', () => {
gulp.task('test', ['pre-test'], () => { gulp.task('test', ['pre-test'], () => {
process.chdir('build'); process.chdir('build');
gulp.src(['test/**/*.js'], {read: false}) gulp.src(['test/**/*.js'], {read: false})
.pipe(mocha({timeout: 30000})) .pipe(mocha({timeout: 60000}))
.pipe(istanbul.writeReports()) .pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({ .pipe(istanbul.enforceThresholds({
thresholds: { thresholds: {
......
...@@ -67,6 +67,20 @@ describe('request enrollments', () => { ...@@ -67,6 +67,20 @@ describe('request enrollments', () => {
}); });
it('should list the administrative dependencies', (done) => { it('should list the administrative dependencies', (done) => {
chai.request(server)
.get('/api/v1/enrollment/adm_dependency_detailed')
.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('id');
res.body.result[0].should.have.property('name');
done();
});
});
it('should list the administrative dependencies detailed', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/enrollment/adm_dependency') .get('/api/v1/enrollment/adm_dependency')
.end((err, res) => { .end((err, res) => {
...@@ -80,6 +94,48 @@ describe('request enrollments', () => { ...@@ -80,6 +94,48 @@ describe('request enrollments', () => {
}); });
}); });
it('should list genders', (done) => {
chai.request(server)
.get('/api/v1/enrollment/gender')
.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('id');
res.body.result[0].should.have.property('name');
done();
});
});
it('should list the ethnic groups', (done) => {
chai.request(server)
.get('/api/v1/enrollment/ethnic_group')
.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('id');
res.body.result[0].should.have.property('name');
done();
});
});
it('should list the periods', (done) => {
chai.request(server)
.get('/api/v1/enrollment/period')
.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('id');
res.body.result[0].should.have.property('name');
done();
});
});
it('should list enrollments', (done) => { it('should list enrollments', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/enrollment') .get('/api/v1/enrollment')
...@@ -155,7 +211,7 @@ describe('request enrollments', () => { ...@@ -155,7 +211,7 @@ describe('request enrollments', () => {
it('should list enrollments with valid dimensions and filters', (done) => { it('should list enrollments with valid dimensions and filters', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/enrollment?dims=region,state,education_level,school&filter=min_year:2015,max_year:2015,city:4106902') .get('/api/v1/enrollment?dims=region,state,education_level,school,gender,period&filter=min_year:2015,max_year:2015,city:4106902')
.end((err, res) => { .end((err, res) => {
res.should.have.status(200); res.should.have.status(200);
res.should.be.json; res.should.be.json;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment