mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
[PM-13374] Update all SDK uuids (#14962)
* fix: broken SDK interface * Fix all compile errors related to uuids * Fix browser desktop * Fix tests --------- Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
This commit is contained in:
@@ -118,15 +118,18 @@ describe("VaultFilter", () => {
|
||||
});
|
||||
|
||||
describe("given an organizational cipher (with organization and collections)", () => {
|
||||
const collection1 = "e9652fc0-1fe4-48d5-a3d8-d821e32fbd98";
|
||||
const collection2 = "42a971a5-8c16-48a3-a725-4be27cd99bc9";
|
||||
|
||||
const cipher = createCipher({
|
||||
organizationId: "organizationId",
|
||||
collectionIds: ["collectionId", "anotherId"],
|
||||
collectionIds: [collection1, collection2],
|
||||
});
|
||||
|
||||
it("should return true when filter matches collection id", () => {
|
||||
const filterFunction = createFilterFunction({
|
||||
selectedCollection: true,
|
||||
selectedCollectionId: "collectionId",
|
||||
selectedCollectionId: collection1,
|
||||
});
|
||||
|
||||
const result = filterFunction(cipher);
|
||||
@@ -137,7 +140,7 @@ describe("VaultFilter", () => {
|
||||
it("should return false when filter does not match collection id", () => {
|
||||
const filterFunction = createFilterFunction({
|
||||
selectedCollection: true,
|
||||
selectedCollectionId: "nonMatchingId",
|
||||
selectedCollectionId: "1ea7ad96-3fc1-4567-8fe5-91aa9f697fd1",
|
||||
});
|
||||
|
||||
const result = filterFunction(cipher);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { asUuid } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
import {
|
||||
CipherViewLike,
|
||||
@@ -65,7 +66,8 @@ export class VaultFilter {
|
||||
}
|
||||
if (this.selectedCollection && this.selectedCollectionId != null && cipherPassesFilter) {
|
||||
cipherPassesFilter =
|
||||
cipher.collectionIds != null && cipher.collectionIds.includes(this.selectedCollectionId);
|
||||
cipher.collectionIds != null &&
|
||||
cipher.collectionIds.includes(asUuid(this.selectedCollectionId));
|
||||
}
|
||||
if (this.selectedOrganizationId != null && cipherPassesFilter) {
|
||||
cipherPassesFilter = cipher.organizationId === this.selectedOrganizationId;
|
||||
|
||||
Reference in New Issue
Block a user