-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathboard-client.js
More file actions
executable file
·56 lines (47 loc) · 1.15 KB
/
board-client.js
File metadata and controls
executable file
·56 lines (47 loc) · 1.15 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
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
54
55
56
import BoardManager from '../lib/client'
import { expect } from 'chai'
import _ from 'lodash'
var bm
, board = {
name: 'test' + Date.now()
, owner: 'test'
}
describe('BoardManager REST api Client', () => {
it('should create a new client', () => {
bm = new BoardManager()
console.log(bm)
})
it('should create a new board', async () => {
var res = await bm.create(board)
expect(res).to.have.property('_id')
console.log(res)
})
it('should get an error if board with the same name exists', async () => {
var thrown = false
try {
var res = await bm.create(board)
} catch (e) {
thrown = true
expect(e).to.exists
}
expect(thrown).to.be.true
})
it('should list boards', async () => {
var res = bm.list()
console.log(res)
})
it('should find the board', async () => {
var res = bm.find(board)
console.log(res)
})
it('should update the board', async () => {
var nb = _.clone(board)
nb.change = 1
var res = bm.update(board, nb)
console.log(res)
})
it('should remove the board', async () => {
var res = bm.remove(board)
console.log(res)
})
})