-
Notifications
You must be signed in to change notification settings - Fork 0
/
documentManagerSpec.js
53 lines (48 loc) · 1.5 KB
/
documentManagerSpec.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// tests for User
function userMock(cb) {
}
function roleMock(cb) {
}
function docMock(cb) {
}
describe('Users', function() {
it('User created is unique', function() {
expect(user.unique()).toBeTruthy();
});
it('User has a role defined', function() {
expect(user.role).toBeDefined;
});
it('User has first and last names', function() {
expect(user.firstname).toBeDefined;
expect(user.lastname).toBeDefined;
});
it('Returns all users created', function() {
expect(getAllUsers()).toEqual(jasmine.arrayContaining([]));
});
});
// tests for roles
describe('"Role"', function() {
it('validates role added has a unique title', function() {
expect(role.unique()).toBeTruthy();
});
it('Returns all roles created', function() {
expect(getAllRoles()).toEqual(jasmine.arrayContaining([]));
});
});
// tests for Document
describe('"Document"', function() {
it('validates document created has a publish date', function() {
expect(documentx.publishDate).toBeDefined;
});
it('Returns all document created', function() {
expect(getAllDocuments()).toEqual(jasmine.arrayContaining([]));
});
});
describe('Search', function() {
it('Returns a specified number of ordered list by date by given role', function() {
expect(getAllDocumentsByRole(role)).not.to.Equal(jasmine.arrayContaining([]));
});
it('Returns a specified number of document published on given date', function() {
expect(getAllDocumentsByDate(date)).not.to.Equal(jasmine.arrayContaining([]));
});
});