合入主线登录和营业时段策略,对齐旧界面与 React 访问流程

This commit is contained in:
黄健铭 committed 2026-12-05 21:46:55 -08:00
commit 42395de23a
113 files changed
+1915 -558

No files matched your search

+24 -6
View File
@@ -151,6 +151,24 @@ test('保存店铺配置使用revision且不提交员工资料;未改分成时
fields.profitShareEffectiveMonth.value = '2026-10';
assert.throws(() => h.run('shopSettingsInput(__form)'), /本月或以后/);
});
test('营业时间原值不随其他字段提交;两项留空清除,跨日有效', () => {
const h = harness();
h.run("state.shopSettings.businessHours={open:'09:00',close:'18:00'}");
const { fields } = h.form();
const input = () => h.json('shopSettingsInput(__form)');
assert.equal(fields.businessOpen.value, '09:00');
assert.equal(fields.businessClose.value, '18:00');
assert.equal(Object.hasOwn(input(), 'businessHours'), false);
fields.businessOpen.value = '20:30';
fields.businessClose.value = '02:00';
assert.deepEqual(input().businessHours, { open: '20:30', close: '02:00' });
fields.businessClose.value = '20:30';
assert.throws(input, /开始和结束时间不能相同/);
fields.businessOpen.value = '';
assert.throws(input, /请完整填写开始和结束时间/);
fields.businessClose.value = '';
assert.equal(input().businessHours, null);
});
test('店铺配置校验阻止错误费率、过大默认费及非店主保存', () => {
const h = harness(),
{ fields } = h.form();
@@ -209,12 +227,12 @@ test('店名、成员及登录文本均转义,配置名不能变成HTML元素'
const people = h.run('peopleCountHTML(null)');
assert.match(people, /<i>成员<\/i>/);
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('../server/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();