feat(claim): 配合方案B支持买家纠错扫码UID自愈绑定,自建页面增加确认更换提示与快捷填入
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
canReuseAffiliateDashBindSnapshot,
|
||||
isAffiliateDashBindSnapshotStale,
|
||||
isAffiliateDashSnapshotFresh,
|
||||
isRockAffiliateDashSku,
|
||||
shouldRefuseRockRebind,
|
||||
shouldRefreshAffiliateDashBindStateForSnapshot,
|
||||
} from './kuaishou-cloud-claim-service.js'
|
||||
|
||||
@@ -123,6 +125,81 @@ test('canReuseAffiliateDashBindSnapshot reuses verified matching bound account',
|
||||
)
|
||||
})
|
||||
|
||||
test('rock rebind is refused after mismatch or after a successful bind changes uid', () => {
|
||||
assert.equal(isRockAffiliateDashSku('rock_black_tshirt'), true)
|
||||
assert.equal(isRockAffiliateDashSku('top_black_elite_trainer'), false)
|
||||
assert.equal(
|
||||
shouldRefuseRockRebind({
|
||||
sku: 'rock_black_tshirt',
|
||||
bindUuid: 'bind-1',
|
||||
bindMismatch: true,
|
||||
}),
|
||||
true,
|
||||
)
|
||||
// 方案 B:买家改回扫码真实账号时放行自愈,改第三个账号时拒绝
|
||||
assert.equal(
|
||||
shouldRefuseRockRebind(
|
||||
{
|
||||
sku: 'rock_black_tshirt',
|
||||
bindUuid: 'bind-1',
|
||||
boundAccount: '3454648872',
|
||||
bindMismatch: true,
|
||||
},
|
||||
'3454648872',
|
||||
),
|
||||
false,
|
||||
)
|
||||
assert.equal(
|
||||
shouldRefuseRockRebind(
|
||||
{
|
||||
sku: 'rock_black_tshirt',
|
||||
bindUuid: 'bind-1',
|
||||
boundAccount: '3454648872',
|
||||
bindMismatch: true,
|
||||
},
|
||||
'9999999999',
|
||||
),
|
||||
true,
|
||||
)
|
||||
assert.equal(
|
||||
shouldRefuseRockRebind(
|
||||
{
|
||||
sku: 'rock_black_tshirt',
|
||||
bindUuid: 'bind-1',
|
||||
bound: true,
|
||||
boundAccount: '111',
|
||||
expectedGameAccount: '111',
|
||||
},
|
||||
'222',
|
||||
),
|
||||
true,
|
||||
)
|
||||
assert.equal(
|
||||
shouldRefuseRockRebind(
|
||||
{
|
||||
sku: 'rock_black_tshirt',
|
||||
bindUuid: 'bind-1',
|
||||
bound: false,
|
||||
bindMismatch: false,
|
||||
expectedGameAccount: '111',
|
||||
},
|
||||
'222',
|
||||
),
|
||||
false,
|
||||
)
|
||||
assert.equal(
|
||||
shouldRefuseRockRebind(
|
||||
{
|
||||
sku: 'skin_other',
|
||||
bindUuid: 'bind-1',
|
||||
bindMismatch: true,
|
||||
},
|
||||
'222',
|
||||
),
|
||||
false,
|
||||
)
|
||||
})
|
||||
|
||||
test('canReuseAffiliateDashBindSnapshot refuses mismatched bound account', () => {
|
||||
assert.equal(
|
||||
canReuseAffiliateDashBindSnapshot(
|
||||
|
||||
Reference in New Issue
Block a user