等员工列表更新完成后验证店铺保存并固定运行起始版本

This commit is contained in:
黄健铭 committed 2026-12-05 02:34:07 -08:00
1 parent 7d2007955f
commit 340100ce6c
2 files changed
+10 -3

No files matched your search

+3 -2
View File
@@ -16,6 +16,7 @@ import { compare, report } from './lib/diff.js';
import { app, git, reference, fixedReference } from './lib/write-reference.mjs'; import { app, git, reference, fixedReference } from './lib/write-reference.mjs';
const candidate = git('rev-parse', 'HEAD');
const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'ledger-write-parity-')); const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'ledger-write-parity-'));
let oldApp; let oldApp;
const day = '2026-11-20'; const day = '2026-11-20';
@@ -306,7 +307,7 @@ try {
: process.argv[only + 1].split(','); : process.argv[only + 1].split(',');
const allHits = {}, const allHits = {},
outcomes = {}; outcomes = {};
console.log('旧版', reference, '新版', git('rev-parse', 'HEAD')); console.log('旧版', reference, '新版', candidate);
process.env.WEB_NEXT = '1'; process.env.WEB_NEXT = '1';
browser = await chromium.launch(); browser = await chromium.launch();
for (const group of groups) { for (const group of groups) {
@@ -377,7 +378,7 @@ try {
const name = only < 0 ? 'all' : groups.join('-') + (process.argv.includes('--prove') ? '-negative' : ''); const name = only < 0 ? 'all' : groups.join('-') + (process.argv.includes('--prove') ? '-negative' : '');
fs.writeFileSync( fs.writeFileSync(
path.join(output, name + '.json'), path.join(output, name + '.json'),
redact(JSON.stringify({ reference, head: git('rev-parse', 'HEAD'), outcomes, coverage: routes }, null, 2)), redact(JSON.stringify({ reference, head: candidate, outcomes, coverage: routes }, null, 2)),
); );
} finally { } finally {
await browser?.close(); await browser?.close();
+7 -1
View File
@@ -49,11 +49,17 @@ export default async function settings(ctx) {
await form.locator('[name=verified]').check(); await form.locator('[name=verified]').check();
await write(ctx, owner, title + '员工', endpoint + verb, () => submit(form)); await write(ctx, owner, title + '员工', endpoint + verb, () => submit(form));
} }
// 旧界面先关闭员工弹窗,再更新店铺表单并重载员工列表。
await row.waitFor({ state: 'detached' });
await owner.locator('[data-employee="owner"]').waitFor();
const shop = owner.locator('#shop-settings-form'), const shop = owner.locator('#shop-settings-form'),
print = owner.locator('#print-settings'); print = owner.locator('#print-settings');
await fill(shop, { storeName: '迁移对照店铺' }); await fill(shop, { storeName: '迁移对照店铺' });
await fill(print, { rows: '8' }); await fill(print, { rows: '8' });
await write(ctx, owner, '保存店铺名称', '/api/shop-settings', () => submit(shop)); await write(ctx, owner, '保存店铺名称', '/api/shop-settings', async () => {
assert.equal(await shop.locator('[name=storeName]').inputValue(), '迁移对照店铺');
await submit(shop);
});
assert.equal(await print.locator('[name=rows]').inputValue(), '8'); assert.equal(await print.locator('[name=rows]').inputValue(), '8');
await write(ctx, owner, '保存打印设置', '/api/printing', () => owner.locator('button[form=print-settings]').click()); await write(ctx, owner, '保存打印设置', '/api/printing', () => owner.locator('button[form=print-settings]').click());
await ctx.step('备份并下载完整账本', async () => { await ctx.step('备份并下载完整账本', async () => {