1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

Redoing the PR for get by domain due to file move (#14746)

This commit is contained in:
Tom
2025-05-13 09:44:54 -04:00
committed by GitHub
parent 00beef617c
commit 9f3310ed7e
2 changed files with 6 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ describe("RiskInsightsReportService", () => {
let testCase = testCaseResults[0]; let testCase = testCaseResults[0];
expect(testCase).toBeTruthy(); expect(testCase).toBeTruthy();
expect(testCase.cipherMembers).toHaveLength(2); expect(testCase.cipherMembers).toHaveLength(2);
expect(testCase.trimmedUris).toHaveLength(3); expect(testCase.trimmedUris).toHaveLength(2);
expect(testCase.weakPasswordDetail).toBeTruthy(); expect(testCase.weakPasswordDetail).toBeTruthy();
expect(testCase.exposedPasswordDetail).toBeTruthy(); expect(testCase.exposedPasswordDetail).toBeTruthy();
expect(testCase.reusedPasswordCount).toEqual(2); expect(testCase.reusedPasswordCount).toEqual(2);
@@ -69,7 +69,7 @@ describe("RiskInsightsReportService", () => {
it("should generate the raw data + uri report correctly", async () => { it("should generate the raw data + uri report correctly", async () => {
const result = await firstValueFrom(service.generateRawDataUriReport$("orgId")); const result = await firstValueFrom(service.generateRawDataUriReport$("orgId"));
expect(result).toHaveLength(9); expect(result).toHaveLength(8);
// Two ciphers that have google.com as their uri. There should be 2 results // Two ciphers that have google.com as their uri. There should be 2 results
const googleResults = result.filter((x) => x.trimmedUri === "google.com"); const googleResults = result.filter((x) => x.trimmedUri === "google.com");
@@ -88,7 +88,7 @@ describe("RiskInsightsReportService", () => {
it("should generate applications health report data correctly", async () => { it("should generate applications health report data correctly", async () => {
const result = await firstValueFrom(service.generateApplicationsReport$("orgId")); const result = await firstValueFrom(service.generateApplicationsReport$("orgId"));
expect(result).toHaveLength(6); expect(result).toHaveLength(5);
// Two ciphers have google.com associated with them. The first cipher // Two ciphers have google.com associated with them. The first cipher
// has 2 members and the second has 4. However, the 2 members in the first // has 2 members and the second has 4. However, the 2 members in the first
@@ -132,7 +132,7 @@ describe("RiskInsightsReportService", () => {
expect(reportSummary.totalMemberCount).toEqual(7); expect(reportSummary.totalMemberCount).toEqual(7);
expect(reportSummary.totalAtRiskMemberCount).toEqual(6); expect(reportSummary.totalAtRiskMemberCount).toEqual(6);
expect(reportSummary.totalApplicationCount).toEqual(6); expect(reportSummary.totalApplicationCount).toEqual(5);
expect(reportSummary.totalAtRiskApplicationCount).toEqual(5); expect(reportSummary.totalAtRiskApplicationCount).toEqual(4);
}); });
}); });

View File

@@ -428,7 +428,7 @@ export class RiskInsightsReportService {
const cipherUris: string[] = []; const cipherUris: string[] = [];
const uris = cipher.login?.uris ?? []; const uris = cipher.login?.uris ?? [];
uris.map((u: { uri: string }) => { uris.map((u: { uri: string }) => {
const uri = Utils.getHostname(u.uri).replace("www.", ""); const uri = Utils.getDomain(u.uri);
if (!cipherUris.includes(uri)) { if (!cipherUris.includes(uri)) {
cipherUris.push(uri); cipherUris.push(uri);
} }