UNPKG

passbolt-styleguide

Version:

Passbolt styleguide contains common styling assets used by the different sites, plugin, etc.

49 lines (46 loc) 1.67 kB
/** * Passbolt ~ Open source password manager for teams * Copyright (c) 2020 Passbolt SA (https://www.passbolt.com) * * Licensed under GNU Affero General Public License version 3 of the or any later version. * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) 2020 Passbolt SA (https://www.passbolt.com) * @license https://opensource.org/licenses/AGPL-3.0 AGPL License * @link https://www.passbolt.com Passbolt(tm) * @since 2.14.0 */ import { defaultAdministratorRbacContext, denyRbacContext, } from "../../../../shared/context/Rbac/RbacContext.test.data"; import { defaultDialogContext } from "../../../contexts/DialogContext.test.data"; import { defaultResourceWorkspaceContext } from "../../../contexts/ResourceWorkspaceContext.test.data"; import { defaultUserAppContext } from "../../../contexts/ExtAppContext.test.data"; /** * Default component props with folder having owner permission * @param {object} data Override the default props. * @returns {object} */ export function defaultProps(data = {}) { return { context: defaultUserAppContext(), rbacContext: defaultAdministratorRbacContext(), dialogContext: defaultDialogContext(), resourceWorkspaceContext: defaultResourceWorkspaceContext(), onClose: jest.fn(), ...data, }; } /** * Props with denied UI action. * @param {object} data Override the default props. * @returns {object} */ export function propsWithDenyUiAction(data = {}) { return defaultProps({ rbacContext: denyRbacContext(), ...data, }); }