feat: 增加店长审核模式与门店经营有效期
This commit is contained in:
@@ -2,16 +2,18 @@ const assert = require('assert')
|
||||
const planningApi = require('../../api/planning')
|
||||
|
||||
let redirectedTo = ''
|
||||
let appGlobalData = {}
|
||||
let lastModal = null
|
||||
global.wx = {
|
||||
getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }),
|
||||
getDeviceInfo: () => ({ platform: 'devtools' }),
|
||||
removeStorageSync: () => {},
|
||||
setStorageSync: () => {},
|
||||
showToast: () => {},
|
||||
showModal: ({ success }) => success({ confirm: true }),
|
||||
showModal: options => { lastModal = options; if (options.success) options.success({ confirm: true }) },
|
||||
redirectTo: ({ url }) => { redirectedTo = url }
|
||||
}
|
||||
global.getApp = () => ({ globalData: {} })
|
||||
global.getApp = () => ({ globalData: appGlobalData })
|
||||
global.getCurrentPages = () => []
|
||||
|
||||
let definition
|
||||
@@ -34,6 +36,14 @@ function createPage() {
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const expiredPage = createPage()
|
||||
expiredPage.data.canCreateAppointment = true
|
||||
appGlobalData.userInfo = { type: 2, shopBusinessExpired: true }
|
||||
await expiredPage.submit()
|
||||
assert.strictEqual(lastModal.title, '门店经营有效期已到期')
|
||||
assert.strictEqual(lastModal.showCancel, false)
|
||||
appGlobalData = {}
|
||||
|
||||
const page = createPage()
|
||||
Object.assign(page.data.form, {
|
||||
customerUserId: '31',
|
||||
|
||||
Reference in New Issue
Block a user