现在有的接口对接测试完成
This commit is contained in:
@@ -6,9 +6,9 @@ const test = require('node:test');
|
||||
const SecurityPages = require('../public/js/security-pages.js');
|
||||
const UploadPages = require('../public/js/upload-pages.js');
|
||||
|
||||
test('security forms use SMS captcha scenes and submit only documented business fields', () => {
|
||||
assert.equal(SecurityPages.getCaptchaScene('phone'), 'PC_PHONE_CHANGE');
|
||||
assert.equal(SecurityPages.getCaptchaScene('deactivate'), 'PC_ACCOUNT_DEACTIVATE');
|
||||
test('security forms use PC verification operation codes and submit only documented business fields', () => {
|
||||
assert.equal(SecurityPages.getCaptchaOperation('phone'), 'phone-change');
|
||||
assert.equal(SecurityPages.getCaptchaOperation('deactivate'), 'account-deactivate');
|
||||
assert.deepEqual(
|
||||
SecurityPages.buildPasswordChangeBody({
|
||||
oldPassword: 'old',
|
||||
@@ -34,10 +34,12 @@ test('security forms use SMS captcha scenes and submit only documented business
|
||||
assert.deepEqual(SecurityPages.buildDeactivateBody({ smsCode: '654321' }), { smsCode: '654321' });
|
||||
});
|
||||
|
||||
test('upload helper exposes only single-file upload support', () => {
|
||||
assert.equal('uploadResumable' in UploadPages, false);
|
||||
assert.equal('buildResumableInitBody' in UploadPages, false);
|
||||
assert.equal(UploadPages.getUploadMode(5 * 1024 * 1024), 'single');
|
||||
test('upload helper keeps the avatar flow blocked until the current PC resumable response is defined', async () => {
|
||||
assert.equal(UploadPages.getUploadMode(5 * 1024 * 1024), 'resumable');
|
||||
await assert.rejects(
|
||||
UploadPages.uploadFileForPage({ initResumableUpload() {} }, { name: 'avatar.png' }),
|
||||
/当前 PC 文件上传响应未定义头像回填字段/
|
||||
);
|
||||
});
|
||||
|
||||
test('security page field names match phone-change and account-deactivation DTOs', () => {
|
||||
|
||||
Reference in New Issue
Block a user