feat(web): promote order notifications and add segmented navigation

This commit is contained in:
abaishu0730 committed 2026-10-19 15:49:34 +08:00
1 parent 87924953d3
commit e2d66eb7c7
27 files changed
+475 -120

No files matched your search

+5 -5
View File
@@ -9,13 +9,13 @@ test('compact navigation groups settings, retains deep links and role boundaries
for(const role of ['admin','viewer']){
const context=await browser.newContext({viewport:{width:1440,height:1000}}),page=await context.newPage();page.on('pageerror',e=>errors.push(e.message));
await page.goto(base+'/#system-settings');await page.getByLabel('账号',{exact:true}).fill(role);await page.getByLabel('密码',{exact:true}).fill(password);await page.getByRole('button',{name:'登录',exact:true}).click();
await page.getByRole('heading',{name:'BPM 连接',exact:true}).first().waitFor();assert.equal(await page.locator('#sidebar-menu [data-view]').count(),6);
await page.getByRole('heading',{name:'BPM 连接',exact:true}).first().waitFor();assert.equal(await page.locator('#sidebar-menu [data-view]').count(),7);
assert.equal(await page.locator('#settings-tabs a[href="#users"]').count(),role==='admin'?1:0);
await page.getByRole('link',{name:'业务设置',exact:true}).click();await page.getByRole('link',{name:'发送计划',exact:true}).click();await page.locator('#schedule-form').waitFor();
assert.equal(await page.locator('#sidebar-menu [aria-current="page"]').getAttribute('href'),'#business-settings');
await page.getByRole('link',{name:'分类通知规则',exact:true}).first().click();await page.getByRole('heading',{name:'分类通知规则',exact:true}).waitFor();
await page.getByRole('link',{name:'订单通知管理',exact:true}).click();await page.getByRole('link',{name:'通知配置',exact:true}).click();await page.locator('#schedule-form').waitFor();
assert.equal(await page.locator('#sidebar-menu [aria-current="page"]').getAttribute('href'),'#order-notifications');
await page.getByRole('link',{name:'业务设置',exact:true}).click();await page.getByRole('heading',{name:'分类通知规则',exact:true}).waitFor();
await page.goto(base+'/#users');await page.getByRole('heading',{name:role==='admin'?'团队账号':'工作总览',exact:true}).first().waitFor();
await page.goto(base+'/#calendar');await page.getByRole('heading',{name:'业务日历',exact:true}).waitFor();assert.equal(await page.locator('#sidebar-menu [aria-current="page"]').getAttribute('href'),'#business-settings');
await page.goto(base+'/#calendar');await page.getByRole('heading',{name:'业务日历',exact:true}).waitFor();assert.equal(await page.locator('#sidebar-menu [aria-current="page"]').getAttribute('href'),'#order-notifications');
await page.goto(base+'/#system-settings');await page.setViewportSize({width:390,height:844});await page.getByRole('button',{name:'展开菜单',exact:true}).click();
await page.locator('#sidebar-menu').getByRole('link',{name:'业务设置',exact:true}).click();await page.getByRole('heading',{name:'分类通知规则',exact:true}).waitFor();
await page.waitForFunction(()=>!document.querySelector('#sidebar-menu').classList.contains('collapsing'));assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true);assert.equal(await page.locator('#sidebar-menu').evaluate(el=>el.classList.contains('show')),false);assert.equal(await page.getByRole('button',{name:'展开菜单',exact:true}).getAttribute('aria-expanded'),'false');