WMS_MAIN/test/app/controller/system.user.getLoginWechatCode.test.js

18 lines
733 B
JavaScript

'use strict';
const assert = require('node:assert/strict');
const { invokeSystemMethod } = require('../../support/system_method_client');
describe('test/app/controller/system.user.getLoginWechatCode.test.js', () => {
it('should return login code without Authorization token', async () => {
const res = await invokeSystemMethod('user.getLoginWechatCode', {});
assert.equal(res.status, 200);
assert.equal(res.body.flag, 'success');
assert.equal(res.body.code, 200);
assert.match(String(res.body?.data?.client_code || ''), /^(?=.*[A-Z])(?=.*\d)[A-Z\d]{6}$/);
assert.match(String(res.body?.data?.code || ''), /^(?=.*[A-Z])(?=.*\d)[A-Z\d]{6}$/);
assert.equal(res.body?.data?.status, 'pending');
});
});