mirror of
https://github.com/bitwarden/browser
synced 2026-02-21 11:54:02 +00:00
* Front end changes to disable SM ads for users * fixing failing tests * Update libs/common/src/admin-console/models/response/organization.response.ts Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * fixing merge conflicts * claude suggestion * adding feature flag for disable sm ads on clients * fixing tests --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
75 lines
2.5 KiB
TypeScript
75 lines
2.5 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,
|
|
useAutomaticUserConfirmation: 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,
|
|
useAccessIntelligence: false,
|
|
useOrganizationDomains: false,
|
|
useAdminSponsoredFamilies: false,
|
|
isAdminInitiated: false,
|
|
ssoEnabled: false,
|
|
ssoMemberDecryptionType: undefined,
|
|
useDisableSMAdsForUsers: false,
|
|
usePhishingBlocker: false,
|
|
},
|
|
};
|
|
const result = sut.deserializer(JSON.parse(JSON.stringify(expectedResult)));
|
|
expect(result).toEqual(expectedResult);
|
|
});
|
|
});
|