功能:增加店长员工审核与登录提醒
This commit is contained in:
@@ -7,9 +7,12 @@ global.wx = {
|
||||
getStorageSync: () => '',
|
||||
setStorageSync: () => {},
|
||||
removeStorageSync: () => {},
|
||||
showToast: () => {}
|
||||
showToast: () => {},
|
||||
showModal: ({ success }) => success({ confirm: false }),
|
||||
switchTab: () => {}
|
||||
}
|
||||
global.getApp = () => ({ globalData: { userInfo: {} } })
|
||||
const appMock = { globalData: { userInfo: {} } }
|
||||
global.getApp = () => appMock
|
||||
|
||||
let definition
|
||||
global.Page = value => { definition = value }
|
||||
@@ -69,6 +72,19 @@ async function run() {
|
||||
assert.strictEqual(calendarRequests, 1)
|
||||
resolveCalendar({ artists: [], appointments: [], daySummaries: [] })
|
||||
await Promise.all([requestOne, requestTwo])
|
||||
|
||||
const employeesApi = require('../../api/employees')
|
||||
const noticePage = createPage()
|
||||
appMock.globalData.userInfo = { type: 2 }
|
||||
appMock.globalData.reviewNoticeShown = false
|
||||
employeesApi.reviewSummary = async () => ({ pendingCount: 2, noticeEnabled: true })
|
||||
let switched = false
|
||||
global.wx.showModal = ({ success }) => success({ confirm: true })
|
||||
global.wx.switchTab = ({ url }) => { switched = url === '/pages/employees/index' }
|
||||
assert.strictEqual(await noticePage.showEmployeeReviewNotice(), true)
|
||||
assert.strictEqual(switched, true)
|
||||
assert.strictEqual(appMock.globalData.reviewNoticeShown, true)
|
||||
assert.strictEqual(appMock.globalData.openEmployeeReview, true)
|
||||
}
|
||||
|
||||
run().catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user