feat: 增加门店身份注销流程
This commit is contained in:
@@ -130,6 +130,25 @@ final class PushNotificationTests: XCTestCase {
|
||||
XCTAssertTrue(api.registrationIDs.isEmpty)
|
||||
}
|
||||
|
||||
/// 注销状态核验期间,不因 SDK 回调或前台重试调用普通业务绑定接口。
|
||||
func testDeregistrationCheckSuspendsBindingWithoutClearingSession() async {
|
||||
authenticate(userID: "100")
|
||||
let token = appStore.session.token
|
||||
let api = PushRegistrationAPIMock()
|
||||
let manager = makeManager(sdk: PushSDKMock(registrationID: "reg-id"), api: api)
|
||||
manager.setAccountBindingSuspended(true)
|
||||
manager.initializeIfPrivacyAccepted()
|
||||
manager.handleLoginCompleted()
|
||||
manager.retryPendingRegistrationUpload()
|
||||
for _ in 0..<10 { await Task.yield() }
|
||||
XCTAssertTrue(api.registrationIDs.isEmpty)
|
||||
XCTAssertEqual(appStore.session.token, token)
|
||||
manager.setAccountBindingSuspended(false)
|
||||
manager.handleLoginCompleted()
|
||||
await waitUntil { api.registrationIDs.count == 1 }
|
||||
XCTAssertEqual(api.registrationIDs, ["reg-id"])
|
||||
}
|
||||
|
||||
func testLoggedOutStateDoesNotUpload() async {
|
||||
appStore.session.privacyAgreementAccepted = true
|
||||
let sdk = PushSDKMock(registrationID: "reg-id")
|
||||
|
||||
Reference in New Issue
Block a user