提交 46a224fa 编写于 作者: study夏羽's avatar study夏羽

jest: fix register

上级 daf820ed
......@@ -45,10 +45,11 @@ describe('uni_modules/uni-id-pages/pages/login/login-withpwd.vue', () => {
await page.callMethod('toRegister')
break;
case "uni-id-password-error":
expect(resLogin.errMsg).toBe("密码错误");
const expectPasswordStr = ["密码错误","Password error"]
expect(expectPasswordStr).toContain(resLogin.errMsg);
await page.setData({
"username": "DCloud",
"password": "dcloud2022",
"password": "unistarter2022",
"agree": true,
})
const resLoginA = await page.callMethod('pwdLogin')
......
......@@ -54,7 +54,8 @@ describe('uni_modules/uni-id-pages/pages/register/register.vue', () => {
expect(resLogin.uid).toHaveLength(24);
break;
case "uni-id-account-exists":
expect(resLogin.errMsg).toBe("此账号已注册");
const expectAccountStr = ["此账号已注册","Account exists"]
expect(expectAccountStr).toContain(resLogin.errMsg);
await page.waitFor(300)
await page.callMethod('toLogin')
break;
......@@ -68,9 +69,11 @@ describe('uni_modules/uni-id-pages/pages/register/register.vue', () => {
case "uni-captcha-verify-fail":
expect(resLogin.errMsg).toBe("验证码错误");
break;
case "SYS_ERR":
console.log("未知错误---SYS_ERR")//[uni-id-co]: request:ok
break;
default:
// console.log(await program.currentPage(), "----------");
console.log(123)
break;
}
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册