-
Notifications
You must be signed in to change notification settings - Fork 0
/
test90_DelCollection.js
41 lines (31 loc) · 1.17 KB
/
test90_DelCollection.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
/* LOWCODE-DATA-APP / copyright 2024 by ma-ha https://github.com/ma-ha / MIT License */
const assert = require( 'assert' )
const axios = require( 'axios' )
const helper = require( './helper' )
const API_URL = 'http://localhost:8888/app/adapter/entity/'
let HEADERS = {
'app-id' : 'mochatest',
'app-secret' : 'mochatest-supasecret-id'
}
describe( 'Delete Collections', () => {
let scopeId = null
before( async () => {
scopeId = await helper.getRootScopeId()
assert.notEqual( scopeId, null )
})
it( 'Delete collection', async () => {
let result = await axios.delete( API_URL + scopeId +'/test', { headers: HEADERS } )
assert.equal( result.status, 200 )
assert.notEqual( result.data, null )
})
it( 'Delete UUID collection', async () => {
let result = await axios.delete( API_URL + scopeId +'/testUUID', { headers: HEADERS } )
assert.equal( result.status, 200 )
assert.notEqual( result.data, null )
})
it( 'Delete TestState collection', async () => {
let result = await axios.delete( API_URL + scopeId +'/TestState', { headers: HEADERS } )
assert.equal( result.status, 200 )
assert.notEqual( result.data, null )
})
})