mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
[PM-24227] Enable TS-strict for Collection Domain models (#15765)
* wip ts-strict * wip ts-strict * wip * cleanup * cleanup * fix story * fix story * fix story * wip * clean up CollectionAdminView construction * fix deprecated function call * fix cli * clean up * fix story * wip * fix cli * requested changes * clean up, fixing minor bugs, more type saftey * assign props in static ctor, clean up
This commit is contained in:
@@ -48,6 +48,7 @@ const createMockCollection = (
|
||||
canEdit: jest.fn(),
|
||||
canDelete: jest.fn(),
|
||||
canViewCollectionInfo: jest.fn(),
|
||||
encrypt: jest.fn(),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -29,23 +29,27 @@ describe("AssignCollectionsComponent", () => {
|
||||
const mockUserId = "mock-user-id" as UserId;
|
||||
const accountService: FakeAccountService = mockAccountServiceWith(mockUserId);
|
||||
|
||||
const editCollection = new CollectionView();
|
||||
editCollection.id = "collection-id" as CollectionId;
|
||||
editCollection.organizationId = "org-id" as OrganizationId;
|
||||
editCollection.name = "Editable Collection";
|
||||
const editCollection = new CollectionView({
|
||||
id: "collection-id" as CollectionId,
|
||||
organizationId: "org-id" as OrganizationId,
|
||||
name: "Editable Collection",
|
||||
});
|
||||
|
||||
editCollection.readOnly = false;
|
||||
editCollection.manage = true;
|
||||
|
||||
const readOnlyCollection1 = new CollectionView();
|
||||
readOnlyCollection1.id = "read-only-collection-id" as CollectionId;
|
||||
readOnlyCollection1.organizationId = "org-id" as OrganizationId;
|
||||
readOnlyCollection1.name = "Read Only Collection";
|
||||
const readOnlyCollection1 = new CollectionView({
|
||||
id: "read-only-collection-id" as CollectionId,
|
||||
organizationId: "org-id" as OrganizationId,
|
||||
name: "Read Only Collection",
|
||||
});
|
||||
readOnlyCollection1.readOnly = true;
|
||||
|
||||
const readOnlyCollection2 = new CollectionView();
|
||||
readOnlyCollection2.id = "read-only-collection-id-2" as CollectionId;
|
||||
readOnlyCollection2.organizationId = "org-id" as OrganizationId;
|
||||
readOnlyCollection2.name = "Read Only Collection 2";
|
||||
const readOnlyCollection2 = new CollectionView({
|
||||
id: "read-only-collection-id-2" as CollectionId,
|
||||
organizationId: "org-id" as OrganizationId,
|
||||
name: "Read Only Collection 2",
|
||||
});
|
||||
readOnlyCollection2.readOnly = true;
|
||||
|
||||
const params = {
|
||||
|
||||
Reference in New Issue
Block a user