refactor: Fix alias duplication for unit and eval tests

This commit is contained in:
2026-07-07 07:26:48 +05:30
parent 0d0b1e5dd8
commit 1aa00532ed
8 changed files with 79 additions and 49 deletions

View File

@@ -72,6 +72,7 @@ export interface IAttribute {
name: string,
value: string,
visibility: AttributeVisibility,
allowedEntities: Set<string> | null,
): void;
getVisibleAttributesFor(viewerId: string): Attribute[];
}
@@ -118,8 +119,11 @@ export function serializeAttributes(attributes: Attribute[]): string {
const lines: string[] = [];
for (const attr of attributes) {
const aclList = Array.from(attr.getAllowedEntities());
const aclStr = aclList.length > 0 ? ` (Visible to: ${aclList.join(", ")})` : "";
lines.push(`* ${attr.name}: ${attr.getValue()} (Visibility: ${attr.getVisibility()})${aclStr}`);
const aclStr =
aclList.length > 0 ? ` (Visible to: ${aclList.join(", ")})` : "";
lines.push(
`* ${attr.name}: ${attr.getValue()} (Visibility: ${attr.getVisibility()})${aclStr}`,
);
}
return lines.join("\n");
}