功能:增加店长员工审核与登录提醒
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
const assert = require('assert')
|
||||
|
||||
const requests = []
|
||||
const storage = {}
|
||||
global.wx = {
|
||||
getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }),
|
||||
getDeviceInfo: () => ({ platform: 'devtools' }),
|
||||
getStorageSync: key => storage[key] || '',
|
||||
setStorageSync: (key, value) => { storage[key] = value },
|
||||
removeStorageSync: key => { delete storage[key] },
|
||||
request: options => {
|
||||
requests.push(options)
|
||||
options.success({ statusCode: 200, data: { code: 200, data: {} } })
|
||||
}
|
||||
}
|
||||
global.getApp = () => ({ clearSession: () => {}, goLogin: () => {} })
|
||||
|
||||
const employeesApi = require('./api/employees')
|
||||
|
||||
async function run() {
|
||||
await employeesApi.reviewSummary()
|
||||
await employeesApi.reviewApplications()
|
||||
await employeesApi.approveApplication(12)
|
||||
await employeesApi.rejectApplication(12, '资料不完整')
|
||||
|
||||
assert.deepStrictEqual(requests.map(item => [item.method || 'GET', item.url, item.data]), [
|
||||
['GET', 'http://127.0.0.1:80/api/admin/user/workbench/registration/summary', undefined],
|
||||
['GET', 'http://127.0.0.1:80/api/admin/user/workbench/registration/list', undefined],
|
||||
['POST', 'http://127.0.0.1:80/api/admin/user/workbench/registration/12/approve', undefined],
|
||||
['POST', 'http://127.0.0.1:80/api/admin/user/workbench/registration/12/reject', { reason: '资料不完整' }]
|
||||
])
|
||||
}
|
||||
|
||||
run().catch(error => {
|
||||
console.error(error)
|
||||
process.exitCode = 1
|
||||
})
|
||||
Reference in New Issue
Block a user