拆分免加载业务脚本的手机登录页

This commit is contained in:
summer committed 2026-12-04 21:45:41 +08:00
1 parent 36ddf35da0
commit 67b145c4b8
10 files changed
+166 -59

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ test('店名、成员及登录文本均转义,配置名不能变成HTML元素'
const h=harness();h.run(`state.shopSettings.storeName='<img src=x>';state.shopSettings.members[0].label='<b>店东</b>';state.shopSettings.members[0].loginName='owner\"<test>';`);
const card=h.run('shopSettingsHTML()'),account=h.run('accountFields("麦麦信用卡")');assert.match(card,/&lt;img src=x&gt;/);assert.match(card,/&lt;b&gt;店东&lt;\/b&gt;/);assert.doesNotMatch(card,/ownerLoginName/);assert.doesNotMatch(card+account,/<img|<b>店东|<test>/);
h.run(`state.shopSettings.members[1].label='<i>成员</i>'`);const people=h.run('peopleCountHTML(null)');assert.match(people,/&lt;i&gt;成员&lt;\/i&gt;/);assert.doesNotMatch(people,/<i>成员/);
const login={innerHTML:''};h.nodes.set('#login',login);h.nodes.set('#shell',{hidden:false});h.run('login()');assert.match(login.innerHTML,/&lt;img src=x&gt;/);assert.doesNotMatch(login.innerHTML,/<img|<b>店东/);
const login=require('../login-page').loginPage({brand:{storeName:h.run('shopBrandName()')},loginOptions:[{member:'owner',label:'<b>店东</b>'}]});assert.match(login,/&lt;img src=x&gt;/);assert.doesNotMatch(login,/<img|<b>店东/);
});
test('历史转账方向、负数返款说明与垫付标题转义配置成员名',()=>{
const h=harness();h.run(`state.shopSettings.members[0].label='<b>店东</b>';state.shopSettings.members[1].label='<i>成员</i>';`);