1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 21:20:27 +00:00

Fix TypeScript implicit any type errors in tests

Add explicit type annotations to newApplications: undefined in test cases
to resolve TS7018 errors. TypeScript cannot infer the type from undefined
alone, so we explicitly annotate it as 'string[] | undefined'.

Fixes:
- Line 279: Added 'as string[] | undefined' to newApplications property
- Line 716: Added 'as string[] | undefined' to newApplications property

This resolves the test suite compilation errors while maintaining the
backward compatibility test coverage for optional newApplications field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2025-10-30 05:46:19 +00:00
parent 306cdd5f53
commit e12ede57bc

View File

@@ -276,7 +276,7 @@ describe("Risk Insights Type Guards", () => {
totalCriticalMemberCount: 4,
totalCriticalAtRiskMemberCount: 1,
totalCriticalAtRiskApplicationCount: 1,
newApplications: undefined,
newApplications: undefined as string[] | undefined,
};
expect(() => validateOrganizationReportSummary(validData)).not.toThrow();
@@ -713,7 +713,7 @@ describe("Risk Insights Type Guards", () => {
totalCriticalMemberCount: 4,
totalCriticalAtRiskMemberCount: 1,
totalCriticalAtRiskApplicationCount: 1,
newApplications: undefined,
newApplications: undefined as string[] | undefined,
};
expect(isOrganizationReportSummary(validData)).toBe(true);
});