tracman-server/test.js

152 lines
2.8 KiB
JavaScript
Raw Normal View History

2017-04-10 01:00:56 -06:00
const chai = require('chai'),
2016-03-31 17:06:21 -06:00
chaiHttp = require('chai-http'),
2016-06-12 20:08:43 -06:00
request = require('supertest'),
2017-04-10 01:00:56 -06:00
server = require('./server');
2016-03-31 17:06:21 -06:00
chai.use(chaiHttp);
2017-04-10 01:00:56 -06:00
2017-04-14 19:46:21 -06:00
describe('Public', function() {
2016-06-12 20:08:43 -06:00
2016-03-31 17:06:21 -06:00
it('Displays homepage', function(done){
2016-06-12 20:08:43 -06:00
request(server).get('/')
.expect(200)
.end(function(err,res){ done(); });
2016-03-31 17:06:21 -06:00
});
2016-06-12 20:08:43 -06:00
it('Displays help page', function(done){
request(server).get('/help')
.expect(200)
.end(function(err,res){ done(); });
});
it('Displays terms of service', function(done){
request(server).get('/terms')
.expect(200)
.end(function(err,res){ done(); });
});
it('Displays privacy policy', function(done){
request(server).get('/privacy')
.expect(200)
.end(function(err,res){ done(); });
});
2016-03-31 17:06:21 -06:00
it('Displays robots.txt', function(done){
2016-06-12 20:08:43 -06:00
request(server).get('/robots.txt')
.expect(200)
.expect('Content-Type', /text/)
.end(function(err,res){ done(); });
});
2016-08-09 23:51:49 -06:00
it('Displays demo map', function(done){
2016-06-12 20:08:43 -06:00
request(server).get('/map/keith')
.expect(200)
.end(function(err,res){ done(); });
2016-03-31 17:06:21 -06:00
});
2016-06-12 20:08:43 -06:00
2016-08-09 23:51:49 -06:00
});
2017-04-14 19:46:21 -06:00
describe('User', function() {
it('Creates an account', function(done){
request(server).post('/signup',{"email":"test@tracman.org"})
.expect(200)
.end(function(err,res){ done(); });
});
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Creates a password', function(done){
// });
//TODO: it('Logs in', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2016-08-09 23:51:49 -06:00
//TODO: it('Logs out', function(done){
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Forgets password', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Changes forgotten password', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Logs back in', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Changes email address', function(done){
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Changes password', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Changes settings', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Connects a Google account', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Connects a Facebook account', function(done){
2016-08-09 23:51:49 -06:00
// });
2016-06-12 20:08:43 -06:00
2017-04-14 19:46:21 -06:00
//TODO: it('Connects a Twitter account', function(done){
// });
//TODO: it('Logs in with Google', function(done){
// });
//TODO: it('Logs in with Facebook', function(done){
// });
//TODO: it('Logs in with Twitter', function(done){
// });
//TODO: it('Disconnects a Google account', function(done){
// });
//TODO: it('Disconnects a Facebook account', function(done){
// });
//TODO: it('Disconnects a Twitter account', function(done){
// });
//TODO: it('Shows own map', function(done){
// request(server).get('/map')
// .expect(200)
// .end(function(err,res){ done(); });
// });
//TODO: it('Sets own location', function(done){
// });
//TODO: it('Tracks own location', function(done){
// });
//TODO: it('Clears own location', function(done){
// });
//TODO: it('Deletes account', function(done){
// });
});