Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
Signed-off-by: tech4GT <[email protected]>
  • Loading branch information
tech4GT committed May 29, 2019
1 parent 922a5d6 commit 8dd6aa4
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions test/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,57 @@ chai.use(chaiHttp);
/*
* Test the /api/v1/process route for network image
*/
describe('/POST /ap1/v1/process', () => {
it('should send status 200', (done) => {
describe('/GET /ap1/v1/process', () => {
it('should send response', (done) => {
chai.request(server)
.post('/api/v1/process')
.send({ url: 'https://publiclab.org/system/images/photos/000/024/687/original/barataria.jpg', upload: false, sequence: 'invert{}' })
.get('/api/v1/process/?steps=[{input":"https://publiclab.org/system/images/photos/000/024/687/original/barataria.jpg","steps"="brightness"}]')
.end((err, res) => {
res.should.have.status(200);
res.should.be.any;
done();
});
});
});

/*
* Test the /api/v1/process route for local image
* Test the /api/v1/export route for network image
*/
describe('/POST /ap1/v1/process', () => {
it('should send status 200', (done) => {
describe('/GET /ap1/v1/export', () => {
it('should send response', (done) => {
chai.request(server)
.post('/api/v1/process')
.send({ url: path.join(__dirname, '../Images/Mario.png'), upload: false, sequence: 'invert{}' })
.get('/api/v1/export/?url=https://mapknitter.org/maps/pvdtest/warpables.json')
.end((err, res) => {
res.should.have.status(200);
res.should.be.any;
done();
});
});
});
describe('/GET /ap1/v2/process', () => {
it('should send response', (done) => {
chai.request(server)
.get('/api/v2/process/?steps=[{"id":1,input":"https://publiclab.org/system/images/photos/000/024/687/original/barataria.jpg","steps"="brightness"}]')
.end((err, res) => {
res.should.be.any;
done();
});
});
});

/*
* Test the /api/v1/export route for network image
*/
describe('/GET /ap1/v2/export', () => {
it('should send response', (done) => {
chai.request(server)
.get('/api/v2/export/?url=https://mapknitter.org/maps/pvdtest/warpables.json')
.end((err, res) => {
res.should.be.any;
done();
});
});
});

/*
* Test the /api/v1/ route
* Test the /api/v2/ route
*/
describe('/POST /ap1/v1/', () => {
it('should send status 404', (done) => {
Expand Down

0 comments on commit 8dd6aa4

Please sign in to comment.