修复(半自动履约): 收口虎牙绑定为单一状态机
This commit is contained in:
@@ -11,15 +11,15 @@ const source = readFileSync(
|
||||
)
|
||||
const styles = readFileSync(join(root, '../src/styles/customer/binding.css'), 'utf8')
|
||||
|
||||
test('资料不一致时不自动弹核对框,由页面两个按钮处理', () => {
|
||||
assert.ok(source.includes("if (bindingInfo.comparison.verdict !== 'match') return"))
|
||||
assert.ok(source.includes('不一致时不弹框'))
|
||||
// 手动刷新时也只有三项一致才打开核对框。
|
||||
assert.ok(source.includes("if (nextBinding?.comparison?.verdict === 'match') {"))
|
||||
test('只有唯一绑定决策允许时才自动弹核对框', () => {
|
||||
assert.ok(source.includes('if (!bindingDecision?.canConfirmBinding) return'))
|
||||
assert.ok(source.includes('if (nextDecision?.canConfirmBinding) {'))
|
||||
assert.ok(!source.includes("bindingInfo.comparison.verdict === 'match'"))
|
||||
})
|
||||
|
||||
test('资料不一致时固定提供重新扫码换绑与上一步修改资料', () => {
|
||||
assert.ok(source.includes('showRebindFailure || comparisonMismatch'))
|
||||
assert.ok(source.includes('decisionRequiresRebind || decisionCanRefreshQr'))
|
||||
assert.ok(source.includes('decisionCanEditProfile'))
|
||||
assert.ok(source.includes('重新扫码换绑'))
|
||||
assert.ok(source.includes('上一步修改资料'))
|
||||
assert.ok(source.includes('onClick={() => void openProfileEditor()}'))
|
||||
@@ -36,7 +36,7 @@ test('保存资料后只由单一自动绑定流程推进,不再并发轮询',
|
||||
const saveBody = source.slice(saveStart, saveStart + 1800)
|
||||
assert.ok(!saveBody.includes('pollCustomerBinding('))
|
||||
assert.ok(source.includes("message.success('资料已保存,正在重新核对平台角色')"))
|
||||
assert.ok(source.includes("if (selectedTask.bindingStatus !== 'not_started'"))
|
||||
assert.ok(source.includes("!['query_binding', 'start_first_binding'].includes"))
|
||||
})
|
||||
|
||||
test('登录和绑定专用同步阶段暂停整单轮询', () => {
|
||||
@@ -48,7 +48,7 @@ test('登录和绑定专用同步阶段暂停整单轮询', () => {
|
||||
|
||||
test('角色名和区服一致才出现确认绑定,不一致时展示原因', () => {
|
||||
assert.ok(source.includes('确认绑定此角色'))
|
||||
assert.ok(source.includes("bindingComparison?.verdict === 'match'"))
|
||||
assert.ok(source.includes('canConfirmDecision'))
|
||||
assert.ok(source.includes('两侧角色信息不一致,无法提交平台绑定'))
|
||||
assert.ok(source.includes('customer-binding-modal-error'))
|
||||
})
|
||||
@@ -65,7 +65,8 @@ test('二维码区明确区分虎牙账号 UID 与游戏角色 UID', () => {
|
||||
|
||||
test('换绑流程刷新二维码必须带 forceRebind,避免直接返回已有角色', () => {
|
||||
assert.ok(source.includes('function handleRefreshBindingQr()'))
|
||||
assert.ok(source.includes('handleRefreshBinding(bindingInfo?.rebindRequested === true)'))
|
||||
assert.ok(source.includes("bindingDecision?.primaryAction === 'start_rebind'"))
|
||||
assert.ok(source.includes("bindingDecision?.primaryAction === 'refresh_rebind_qr'"))
|
||||
// 三处刷新/重新获取入口都不能再固定传 false。
|
||||
assert.ok(!source.includes('handleRefreshBinding(false)'))
|
||||
assert.ok(source.includes('onClick={handleRefreshBindingQr}'))
|
||||
|
||||
Reference in New Issue
Block a user