功能:增加店长员工审核与登录提醒

This commit is contained in:
2026-10-12 16:45:42 +08:00
parent 247472fcae
commit e4aff0803a
23 changed files with 769 additions and 24 deletions
+18 -2
View File
@@ -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 => {