-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
28 lines (24 loc) · 1.07 KB
/
Copy pathtest.js
File metadata and controls
28 lines (24 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const app = require('./server');
const request = require('supertest');
describe('Facebook OAuth2 API', () => {
it('should return API message on root', async () => {
const response = await request(app).get('/');
expect(response.status).toBe(200);
expect(response.body.message).toBe('MettaChain PropChain Backend API');
});
it('should return 401 for profile without authentication', async () => {
const response = await request(app).get('/profile');
expect(response.status).toBe(401);
expect(response.body.message).toBe('Not authenticated');
});
it('should return 401 for link-facebook without authentication', async () => {
const response = await request(app).post('/auth/link-facebook');
expect(response.status).toBe(401);
expect(response.body.message).toBe('Not authenticated');
});
it('should return 401 for sync-profile without authentication', async () => {
const response = await request(app).post('/auth/sync-profile');
expect(response.status).toBe(401);
expect(response.body.message).toBe('Not authenticated');
});
});