test(公司tab): 补「超管选了公司但没选分组」这条水路的用例,并订正缺口清单的任务号
变异目录第 8 轮(ReadScope.userIdsOr 的 base==null 腿退化成空集)第一轮**存活**,
66 支一支不红。不是变异点在 mock 外面,而是这一轮两页都没测这条路径——而 tab
默认选中第一家,超管开页走的恰恰就是它(base=null + 公司集 ⇒ 本应交出公司成员集,
被 Mutation 打成空页时无人报警)。两页各补一条同形用例后重放:C0' 68 全绿、
M8 RED 2,红的正是这两条 ⇒ 变异 9/9。
顺带订正登记表里两条会误导人的任务号(按 docs/plans/19-company-tab.md 的任务标题):
admin_task_center 归 Task 10、admin_device_logs 归 Task 12(原先写成 9/10,差一笔)。
验证(验证树 D:/tmp-wt-19ct,基线 = 当前 HEAD 3724e1e4 + 我这 3 支文件):
- 后端全量 3732 / 0 failures / 0 errors / 7 skipped,BUILD SUCCESS。
- 计时用例 HttpClientTimeoutEffectiveTest 上一轮全量里红过一次
(根因读到 "connection closed locally" 而非超时),单跑 8/8 绿、本轮全量 8/8 绿
⇒ 判为并发负载下的假红,不在我的差分里(我的改动只碰 usersecret 的两支测试与一份登记表注释)。
- 前端 1726 例 / 1725 绿 / 1 红 = 缺口尺子本身(还剩 4 页未接线,设计内);vue-tsc rc=0。
This commit is contained in:
@@ -47,7 +47,7 @@ const COMPANY_ID_SOURCE_PINS: Readonly<Record<string, readonly CompanyIdPin[]>>
|
||||
},
|
||||
],
|
||||
admin_task_center: [
|
||||
{ file: 'src/api/task-center.ts', shape: null, note: 'Task 9 未接线(已在缺口清单里);谁接线谁把 null 换成本函数真实取值口' },
|
||||
{ file: 'src/api/task-center.ts', shape: null, note: 'Task 10 未接线(已在缺口清单里);谁接线谁把 null 换成本函数真实取值口' },
|
||||
{ file: 'src/pages/task-center/task-center-model.ts', shape: null, note: '同上:这一页有两个取数模块,两个都得登记' },
|
||||
],
|
||||
admin_user_secret_usage: [
|
||||
@@ -67,7 +67,7 @@ const COMPANY_ID_SOURCE_PINS: Readonly<Record<string, readonly CompanyIdPin[]>>
|
||||
},
|
||||
],
|
||||
admin_device_logs: [
|
||||
{ file: 'src/api/device-logs.ts', shape: null, note: 'Task 10 未接线(已在缺口清单里)' },
|
||||
{ file: 'src/api/device-logs.ts', shape: null, note: 'Task 12 未接线(已在缺口清单里)' },
|
||||
],
|
||||
admin_group_manage: [
|
||||
{ file: 'src/pages/account/shop-group-api.ts', shape: null, note: 'Task 11 未接线(已在缺口清单里)' },
|
||||
|
||||
+11
@@ -667,6 +667,17 @@ class UserApiSecretServiceTest {
|
||||
assertThat(service.scopedUserIds(operator, null, ReadScope.unfiltered())).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("超管选了公司但没选分组:base 为 null 时必须交出公司成员集(tab 默认选中第一家,这是最普通的水路)")
|
||||
void superAdminWithCompanyAndNoGroupYieldsCompanySet() {
|
||||
UserApiSecretService service = newService();
|
||||
AdminUserEntity operator = new AdminUserEntity();
|
||||
operator.setId(88L);
|
||||
when(adminAuthSupport.currentRole(operator)).thenReturn("super_admin");
|
||||
assertThat(service.scopedUserIds(operator, null, ReadScope.users(List.of(11L, 12L))))
|
||||
.containsExactlyInAnyOrder(11L, 12L);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("主管:组长锁定 ∩ 公司成员集;越界公司的成员集是空集 ⇒ 空页,不是全量")
|
||||
void leaderVisibleSetIsNarrowedByCompany() {
|
||||
|
||||
+11
@@ -241,6 +241,17 @@ class UserSecretUsageServiceTest {
|
||||
.containsExactlyInAnyOrder(1L, 2L, 88L);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("用量统计:超管选了公司但没选分组时 base 为 null,必须交出公司成员集(tab 默认选中第一家的水路)")
|
||||
void superAdminWithCompanyAndNoGroupYieldsCompanySet() {
|
||||
UserSecretUsageService service = newService();
|
||||
AdminUserEntity operator = new AdminUserEntity();
|
||||
operator.setId(88L);
|
||||
when(adminAuthSupport.currentRole(any())).thenReturn("super_admin");
|
||||
assertThat(service.scopedUserIds(operator, null, ReadScope.users(List.of(11L, 12L))))
|
||||
.containsExactlyInAnyOrder(11L, 12L);
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void attachLogAppender() {
|
||||
Logger logger = (Logger) LoggerFactory.getLogger(UserSecretUsageService.class);
|
||||
|
||||
Reference in New Issue
Block a user