16beb69db8
- 吸收 PR #193/#194 后补齐 GoPay 订阅确认步骤注册,保持 GoPay Plus 为订阅确认后进入 OAuth 的 11 步流程。 - 修复手机号接码 provider 合并冲突,恢复 5sim/NexSMS/provider 顺序、复用池、价格阶梯和国家回退逻辑。 - 影响范围:共享步骤定义、background 步骤注册、手机号验证 Step 9、相关单元测试。
32 lines
1.7 KiB
JavaScript
32 lines
1.7 KiB
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
|
|
test('background imports step registry and shared step definitions', () => {
|
|
const source = fs.readFileSync('background.js', 'utf8');
|
|
assert.match(source, /background\/steps\/registry\.js/);
|
|
assert.match(source, /data\/step-definitions\.js/);
|
|
assert.match(source, /MultiPageStepDefinitions\?\.getSteps/);
|
|
assert.match(source, /getStepRegistryForState\(state\)/);
|
|
assert.match(source, /PLUS_PAYPAL_STEP_DEFINITIONS/);
|
|
assert.match(source, /PLUS_GOPAY_STEP_DEFINITIONS/);
|
|
assert.match(source, /plusPayPalStepRegistry/);
|
|
assert.match(source, /plusGoPayStepRegistry/);
|
|
assert.match(source, /normalizePlusPaymentMethod\(state\?\.plusPaymentMethod\) === PLUS_PAYMENT_METHOD_GOPAY/);
|
|
assert.match(source, /activeStepRegistry\.executeStep\(step,\s*\{/);
|
|
assert.match(source, /background\/steps\/create-plus-checkout\.js/);
|
|
assert.match(source, /background\/steps\/fill-plus-checkout\.js/);
|
|
assert.match(source, /background\/steps\/gopay-manual-confirm\.js/);
|
|
assert.match(source, /'gopay-subscription-confirm': \(state\) => goPayManualConfirmExecutor\.executeGoPayManualConfirm\(state\)/);
|
|
assert.match(source, /background\/steps\/paypal-approve\.js/);
|
|
assert.match(source, /background\/steps\/gopay-approve\.js/);
|
|
assert.match(source, /background\/steps\/plus-return-confirm\.js/);
|
|
});
|
|
|
|
|
|
test('GoPay approve executor receives debugger click and manual OTP helpers', () => {
|
|
const source = fs.readFileSync('background.js', 'utf8');
|
|
assert.match(source, /createGoPayApproveExecutor\(\{[\s\S]*clickWithDebugger[\s\S]*requestGoPayOtpInput[\s\S]*\}\)/);
|
|
assert.match(source, /REQUEST_GOPAY_OTP_INPUT/);
|
|
});
|