UNPKG

passbolt-styleguide

Version:

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

40 lines (37 loc) 1.03 kB
import MockPort from "../../../test/mock/MockPort"; import { defaultUserRbacContext } from "../../../../shared/context/Rbac/RbacContext.test.data"; /** * Returns the default app context for the unit test * @param appContext An existing app context * @returns {any | ({port: MockPort} & {})} */ export function defaultAppContext(appContext) { const defaultAppContext = { port: new MockPort(), roles: [ { id: "8e3874ae-4b40-590b-968a-418f704b9d9a", name: "admin", }, { id: "8e3874ae-4b40-590b-968a-418f704b9d9b", name: "user", }, ], setContext: function (newContext) { // In this scope this reference the object context. Object.assign(this, newContext); }, }; return Object.assign(defaultAppContext, appContext || {}); } /** * Default props one selected resource owned * @returns {{resourceWorkspaceContext}} */ export function defaultProps(data = {}) { return { rbacContext: defaultUserRbacContext(), ...data, }; }