mirror of
https://github.com/bitwarden/browser
synced 2026-02-09 21:20:27 +00:00
* Added nav item for f4e in org admin console * shotgun surgery for adding "useAdminSponsoredFamilies" feature from the org table * Resolved issue with members nav item also being selected when f4e is selected * Separated out billing's logic from the org layout component * Removed unused observable * Moved logic to existing f4e policy service and added unit tests * Resolved script typescript error * Resolved goofy switchMap --------- Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
68 lines
2.3 KiB
TypeScript
68 lines
2.3 KiB
TypeScript
import { ProductTierType } from "../../../billing/enums/product-tier-type.enum";
|
|
import { OrganizationUserStatusType, OrganizationUserType } from "../../enums";
|
|
import { ORGANIZATIONS } from "../../services/organization/organization.state";
|
|
|
|
import { OrganizationData } from "./organization.data";
|
|
|
|
describe("ORGANIZATIONS state", () => {
|
|
const sut = ORGANIZATIONS;
|
|
|
|
it("should deserialize JSON string to proper object", async () => {
|
|
const expectedResult: Record<string, OrganizationData> = {
|
|
"1": {
|
|
id: "id",
|
|
name: "name",
|
|
status: OrganizationUserStatusType.Invited,
|
|
type: OrganizationUserType.Owner,
|
|
enabled: false,
|
|
usePolicies: false,
|
|
useGroups: false,
|
|
useDirectory: false,
|
|
useEvents: false,
|
|
useTotp: false,
|
|
use2fa: false,
|
|
useApi: false,
|
|
useSso: false,
|
|
useKeyConnector: false,
|
|
useScim: false,
|
|
useCustomPermissions: false,
|
|
useResetPassword: false,
|
|
useSecretsManager: false,
|
|
usePasswordManager: false,
|
|
useActivateAutofillPolicy: false,
|
|
selfHost: false,
|
|
usersGetPremium: false,
|
|
seats: 0,
|
|
maxCollections: 0,
|
|
ssoBound: false,
|
|
identifier: "identifier",
|
|
permissions: undefined,
|
|
resetPasswordEnrolled: false,
|
|
userId: "userId",
|
|
organizationUserId: "organizationUserId",
|
|
hasPublicAndPrivateKeys: false,
|
|
providerId: "providerId",
|
|
providerName: "providerName",
|
|
isProviderUser: false,
|
|
isMember: false,
|
|
familySponsorshipFriendlyName: "fsfn",
|
|
familySponsorshipAvailable: false,
|
|
productTierType: ProductTierType.Free,
|
|
keyConnectorEnabled: false,
|
|
keyConnectorUrl: "kcu",
|
|
accessSecretsManager: false,
|
|
limitCollectionCreation: false,
|
|
limitCollectionDeletion: false,
|
|
limitItemDeletion: false,
|
|
allowAdminAccessToAllCollectionItems: false,
|
|
familySponsorshipLastSyncDate: new Date(),
|
|
userIsManagedByOrganization: false,
|
|
useRiskInsights: false,
|
|
useAdminSponsoredFamilies: false,
|
|
},
|
|
};
|
|
const result = sut.deserializer(JSON.parse(JSON.stringify(expectedResult)));
|
|
expect(result).toEqual(expectedResult);
|
|
});
|
|
});
|