feat: add wild photographer report mock flow
This commit is contained in:
@ -120,4 +120,27 @@ final class AllFunctionsViewModelTests: XCTestCase {
|
||||
XCTAssertEqual(viewModel.moreMenus.map(\.uri), ["wallet"])
|
||||
XCTAssertTrue(viewModel.didCustomize)
|
||||
}
|
||||
|
||||
func testPhotographerReportMenuVisibleAndCanBeAddedToCommon() {
|
||||
appStore.savePermissionItems([
|
||||
HomePermissionItem(id: "1", name: "位置上报", uri: "location_report"),
|
||||
HomePermissionItem(id: "2", name: "举报摄影师", uri: "report_photographer"),
|
||||
])
|
||||
menuStore.saveCommonURIs(
|
||||
["location_report"],
|
||||
accountScope: appStore.accountCachePrefix,
|
||||
roleCode: appStore.roleCode
|
||||
)
|
||||
let viewModel = AllFunctionsViewModel(appStore: appStore, commonMenuStore: menuStore)
|
||||
|
||||
viewModel.loadFunctions()
|
||||
|
||||
XCTAssertEqual(HomeMenuCatalog.item(for: "report_photographer")?.title, "举报摄影师")
|
||||
XCTAssertEqual(viewModel.moreMenus.map(\.uri), ["report_photographer"])
|
||||
|
||||
let menu = viewModel.moreMenus[0]
|
||||
viewModel.addToCommon(menu)
|
||||
|
||||
XCTAssertEqual(viewModel.commonMenus.map(\.uri), ["location_report", "report_photographer"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user