保存同行基础版:店铺配置与员工管理
This commit is contained in:
1 parent
ecb8d6dec0
commit
b7b987064b
84 files changed
+1884
-573
No files matched your search
@@ -30,10 +30,11 @@ test('新表单不带尺寸和旧客户端只改尺寸均保存固定纸型,
|
||||
const {app,call}=await fixture(t),old={store:'原店名',subtitle:'保留标题',contact:'保留联系信息',width:140,height:241,offsetX:3,offsetY:4,contentTop:16,rowHeight:11,rows:6};
|
||||
app.ledger.setMeta('printing',old);const before=businessSnapshot(app.ledger);
|
||||
const input={store:'更新店名',offsetY:5};assert.equal((await call('/api/printing',input)).status,200);
|
||||
const expected={...old,...input,width:241,height:140};assert.deepEqual(app.ledger.meta('printing'),expected);
|
||||
const expected={...old,...input,width:241,height:140},{store,subtitle,contact,...layout}=expected;assert.deepEqual(app.ledger.meta('printing'),layout);
|
||||
assert.equal(app.ledger.shopSettings().storeName,store);assert.equal(app.ledger.shopSettings().receiptSubtitle,subtitle);assert.equal(app.ledger.shopSettings().contact,contact);
|
||||
for(const sizes of [{width:300,height:400},{width:'无效旧宽度',height:-1}]){
|
||||
assert.equal((await call('/api/printing',sizes)).status,200);
|
||||
assert.deepEqual(app.ledger.meta('printing'),expected);
|
||||
assert.deepEqual(app.ledger.meta('printing'),layout);
|
||||
const state=await(await call('/api/state')).json();assert.deepEqual(state.printing,expected);
|
||||
}
|
||||
assert.deepEqual(businessSnapshot(app.ledger),before);
|
||||
|
||||
Reference in new issue
Block a user