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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user