-
Notifications
You must be signed in to change notification settings - Fork 0
/
test99_TeanantTeardown.js
40 lines (29 loc) · 1.23 KB
/
test99_TeanantTeardown.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
/* 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 SCOPE_API_URL = 'http://localhost:8888/app/adapter/scope'
const USER_API_URL = 'http://localhost:8888/app/adapter/user'
let HEADERS = { 'provisioning-key': 'CHANGE_ME' }
describe( 'Tenant Teardown', () => {
let scopeId = null
before( async () => {
scopeId = await helper.getRootScopeId()
assert.notEqual( scopeId, null )
})
it( 'Delete admin user', async () => {
let result = await axios.delete( USER_API_URL,{ data: { userId: 'mochatest@t.de' }, headers: HEADERS } )
assert.equal( result.status, 200 )
assert.equal( result.data.status, 'OK' )
})
it( 'Delete SP', async () => {
let result = await axios.delete( USER_API_URL, { data: { userId: 'mochatest' }, headers: HEADERS } )
assert.equal( result.status, 200 )
assert.equal( result.data.status, 'OK' )
})
it( 'Delete root scope', async () => {
let result = await axios.delete( SCOPE_API_URL, { data: { scopeId: scopeId }, headers: HEADERS } )
assert.equal( result.status, 200 )
assert.equal( result.data.status, 'OK' )
})
})