Skip to content

Commit a7cacc2

Browse files
committed
test(lint): hold approval-approvers-may-resolve-empty's one-line fixes and explanation to #22824's administrators' slate
Claude-Session: https://claude.ai/code/session_01KNKBCRDJCu5tGy3TEbvtrF Co-authored-by: Claude <noreply@anthropic.com>
1 parent bf78c17 commit a7cacc2

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

‎packages/lint/src/validate-approval-approvers.test.ts‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,19 +820,39 @@ describe('[#22161] one-line fixes — approval-approvers-may-resolve-empty', ()
820820
const [group] = validateApprovalApprovers(stackWithApprovers([{ type: 'position', value: 'exec' }]));
821821
expect(group.hint).toBe(
822822
"Staff at least one target, add an approver that cannot resolve empty (e.g. { type: 'org_membership_level', " +
823-
"value: 'owner' }), or declare onEmptyApprovers: 'fallback' with a fallbackApprovers list",
823+
"value: 'owner' }), or name who decides in fallbackApprovers with onEmptyApprovers: 'fallback'",
824824
);
825825
});
826826

827827
it('`os explain` carries what the `fix:` lines no longer say', () => {
828828
const text = explainRule(APPROVAL_APPROVERS_MAY_RESOLVE_EMPTY)!.paragraphs.join('\n');
829829
for (const fact of [
830830
'make sure at least one target is always staffed',
831-
'recoverable only by a platform/tenant admin override',
832-
'which may act on any pending request',
831+
// #22824: a slate that names no one opens on the organization's
832+
// administrators; `fallback` names who decides instead.
833+
"a slate that still names no one opens on the organization's administrators",
834+
'names who decides instead',
835+
"instead of on the organization's administrators, which needs no write to the column at all",
833836
'/api/v1/auth/admin/set-user-manager',
834837
'/api/v1/auth/admin/import-users',
835838
'needs no write to the column at all',
836839
]) expect(text, `explanation names ${fact}`).toContain(fact);
837840
});
838841
});
842+
843+
// [#22161] Slice 11, after #22824 landed beside it: no sentence the rule prints
844+
// or explains may still describe the empty-slate outcome #22824 retired (the
845+
// request waiting on a slate nobody can act on, decided only by an override
846+
// for an organization that HAS administrators).
847+
describe('[#22161] one-line fixes — approval-approvers-may-resolve-empty, against #22824', () => {
848+
it('neither fix line nor the explanation describes the retired empty-slate outcome', () => {
849+
const [group] = validateApprovalApprovers(stackWithApprovers([{ type: 'position', value: 'exec' }]));
850+
const [manager] = validateApprovalApprovers(stackWithApprovers([{ type: 'manager' }]));
851+
const text = explainRule(APPROVAL_APPROVERS_MAY_RESOLVE_EMPTY)!.paragraphs.join('\n');
852+
for (const printed of [group.hint, manager.hint, text]) {
853+
expect(printed).not.toMatch(/waits forever|recoverable only|nobody can act on|no in-product recovery/);
854+
}
855+
// The override survives only as the no-administrator case.
856+
expect(text).toContain("only an organization with no administrator leaves the request on an empty");
857+
});
858+
});

0 commit comments

Comments
 (0)