将助理成员显示名称统一为娜娜和小昊
This commit is contained in:
1 parent
f4ac7502d3
commit
518513e630
28 files changed
+120
-96
No files matched your search
@@ -24,6 +24,7 @@ async function fixture(t){
|
||||
}
|
||||
test('三个真实登录会话按固定成员隔离订单、客户、业绩利润、打印和所有直接ID入口',async t=>{
|
||||
const f=await fixture(t),ids={};for(const member of ['owner','assistant','assistant2'])ids[member]=await f.issue(member);
|
||||
for(const [name,member] of [['娜娜','assistant'],['小昊','assistant2']]){const login=await f.call(member,'/api/login',{name,password});assert.equal(login.status,200);assert.equal(login.body.user.member,member);assert.equal(login.body.user.label,name);}
|
||||
for(const self of ['assistant','assistant2']){
|
||||
const other=self==='assistant'?'assistant2':'assistant',foreign=f.ledger.detail(ids[other]),own=f.ledger.detail(ids[self]);
|
||||
for(const route of ['/api/state','/api/order-book?date='+today(),'/api/report?date='+today(),'/api/report?date='+today()+'&basis=orderDate']){
|
||||
@@ -45,7 +46,7 @@ test('三个真实登录会话按固定成员隔离订单、客户、业绩利
|
||||
assert.equal(f.ledger.actor,null);assert.equal(f.ledger.memberFilter,null);
|
||||
// 改显示名、冒充另一个开单人,均不改变账号及原订单的归属。
|
||||
const helper=f.ledger.one("SELECT user_id FROM team_user_members WHERE member='assistant2'");f.ledger.run('UPDATE users SET name=? WHERE id=?','任意新显示名',helper.user_id);
|
||||
const unchanged=(await f.call('assistant2','/api/session')).body.user;assert.equal(unchanged.member,'assistant2');assert.equal(unchanged.label,'助理2');
|
||||
const unchanged=(await f.call('assistant2','/api/session')).body.user;assert.equal(unchanged.member,'assistant2');assert.equal(unchanged.label,'小昊');
|
||||
assert.equal((await f.call('assistant','/api/orders/issue',{member:'assistant2'})).status,403);
|
||||
const mine=(await f.call('assistant2','/api/orders/'+ids.assistant2+'/edit')).body;
|
||||
assert.equal((await f.call('assistant2','/api/orders/'+ids.assistant2+'/edit',{...mine.inputs,member:'assistant',revision:mine.revision,verified:true,reason:'不能换归属'})).status,403);
|
||||
|
||||
Reference in new issue
Block a user