feat: add wild photographer report mock flow

This commit is contained in:
2026-07-08 12:06:13 +08:00
parent 87fba3d5d6
commit 8a65d3c104
14 changed files with 3542 additions and 0 deletions

View File

@ -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"])
}
}