test(api): fix key-order expectation in users-lookup e2e
Object.keys().sort() 是码点序(大小写敏感):'localLocked'(大写 L)排 在 'locale' 之前;原断言字面量按不区分大小写的字母序书写导致确定性失败 (P4a Task 2 全量回归时暴露,与 HEAD 行为无关的既有笔误)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -137,7 +137,8 @@ describe('账号查询 GET /admin/users (e2e)', () => {
|
|||||||
expect(items.map((item) => item.id)).toEqual([albertId, aliceId]);
|
expect(items.map((item) => item.id)).toEqual([albertId, aliceId]);
|
||||||
expect(items.map((item) => item.displayName)).toEqual(['艾伯', '爱丽']);
|
expect(items.map((item) => item.displayName)).toEqual(['艾伯', '爱丽']);
|
||||||
// 条目形状:AdminUser 字段集(治理字段随 P4a 统一暴露;仍无邮箱/手机/
|
// 条目形状:AdminUser 字段集(治理字段随 P4a 统一暴露;仍无邮箱/手机/
|
||||||
// 密码哈希等凭据字段)。
|
// 密码哈希等凭据字段)。注意数组序 = Array#sort 的码点序(大小写敏感):
|
||||||
|
// 'localLocked'(大写 L,0x4C)排在 'locale'(e,0x65)之前。
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
expect(Object.keys(item).sort()).toEqual([
|
expect(Object.keys(item).sort()).toEqual([
|
||||||
'account',
|
'account',
|
||||||
@@ -145,8 +146,8 @@ describe('账号查询 GET /admin/users (e2e)', () => {
|
|||||||
'credentialStatus',
|
'credentialStatus',
|
||||||
'displayName',
|
'displayName',
|
||||||
'id',
|
'id',
|
||||||
'locale',
|
|
||||||
'localLocked',
|
'localLocked',
|
||||||
|
'locale',
|
||||||
'role',
|
'role',
|
||||||
'sourceStatus',
|
'sourceStatus',
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user