UNPKG

passbolt-styleguide

Version:

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

136 lines (130 loc) โ€ข 3.69 kB
/** * Returns the default app context for the unit test * @param appContext An existing app context * @returns {any} */ import MockPort from "../../../react-extension/test/mock/MockPort"; import UserSettings from "../../../shared/lib/Settings/UserSettings"; import userSettingsFixture from "../../../react-extension/test/fixture/Settings/userSettings"; export function defaultAppContext(appContext) { const defaultAppContext = { port: new MockPort(), userSettings: new UserSettings(userSettingsFixture), siteSettings: { canIUse: () => true } }; return Object.assign(defaultAppContext, appContext || {}); } /** * Default props * @returns {*} */ export function defaultProps() { return { prepareResourceContext: { getSettings: () => settingsPasswordGenerator, settings: settingsPasswordGenerator, getPreparedResource: jest.fn(), getLastGeneratedPassword: jest.fn(() => "AAAAAAAAAAAAAAAAAA") } }; } const settingsPasswordGenerator = { default_generator: "password", generators: [ { "name": "Password", "type": "password", "default_options": { "length": 18, "look_alike": true, "min_length": 8, "max_length": 128, }, "masks": [ { "name": "upper", "label": "A-Z", "characters": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "active": true }, { "name": "lower", "label": "a-z", "characters": "abcdefghijklmnopqrstuvwxyz", "active": true }, { "name": "digit", "label": "0-9", "characters": "0123456789", "active": true }, { "name": "special_char1", "label": "# $ % & @ ^ ~", "characters": "#$%&@^~", "active": true }, { "name": "parenthesis", "label": "{ [ ( | ) ] ] }", "characters": "([|])", "active": true }, { "name": "special_char2", "label": ". , : ;", "characters": ".,:;", "active": true }, { "name": "special_char3", "label": "' \" `", "characters": "'\"`", "active": true }, { "name": "special_char4", "label": "/ \\ _ -", "characters": "/\\_-", "active": true }, { "name": "special_char5", "label": "< * + ! ? =", "characters": "<*+!?=", "active": true }, { "name": "emoji", "label": "๐Ÿ˜˜", "characters": "๐Ÿ˜€๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜๐Ÿ˜†๐Ÿ˜…๐Ÿ˜‚๐Ÿคฃ๐Ÿฅฒโ˜บ๏ธ๐Ÿ˜Š๐Ÿ˜‡๐Ÿ™‚๐Ÿ™ƒ๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜๐Ÿฅฐ๐Ÿ˜˜๐Ÿ˜—๐Ÿ˜™๐Ÿ˜š๐Ÿ˜‹๐Ÿ˜›๐Ÿ˜๐Ÿ˜œ๐Ÿคช๐Ÿคจ๐Ÿง๐Ÿค“๐Ÿ˜Ž๐Ÿฅธ๐Ÿคฉ๐Ÿฅณ๐Ÿ˜๐Ÿ˜’๐Ÿ˜ž๐Ÿ˜”๐Ÿ˜Ÿ๐Ÿ˜•๐Ÿ™โ˜น๏ธ๐Ÿ˜ฃ๐Ÿ˜–๐Ÿ˜ซ๐Ÿ˜ฉ๐Ÿฅบ๐Ÿ˜ข๐Ÿ˜ญ๐Ÿ˜ค๐Ÿ˜ ๐Ÿ˜ก๐Ÿคฌ๐Ÿคฏ๐Ÿ˜ณ๐Ÿฅต๐Ÿฅถ๐Ÿ˜ฑ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฅ๐Ÿ˜“๐Ÿค—๐Ÿค”๐Ÿคญ๐Ÿคซ๐Ÿคฅ๐Ÿ˜ถ๐Ÿ˜๐Ÿ˜‘๐Ÿ˜ฌ๐Ÿ™„๐Ÿ˜ฏ๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜ฎ๐Ÿ˜ฒ๐Ÿฅฑ๐Ÿ˜ด๐Ÿคค๐Ÿ˜ช๐Ÿ˜ต๐Ÿค๐Ÿฅด๐Ÿคข๐Ÿคฎ๐Ÿคง๐Ÿ˜ท๐Ÿค’๐Ÿค•๐Ÿค‘๐Ÿค ๐Ÿ˜ˆ๐Ÿ‘ฟ๐Ÿ‘น๐Ÿ‘บ๐Ÿคก๐Ÿ’ฉ๐Ÿ‘ป๐Ÿ’€โ˜ ๏ธ๐Ÿ‘ฝ๐Ÿ‘พ๐Ÿค–๐ŸŽƒ๐Ÿ˜บ๐Ÿ˜ธ๐Ÿ˜น๐Ÿ˜ป๐Ÿ˜ผ๐Ÿ˜ฝ๐Ÿ™€๐Ÿ˜ฟ๐Ÿ˜พ" } ], }, { "name": "Passphrase", "type": "passphrase", "default_options": { "word_count": 8, "word_case": "lowercase", "min_word": 4, "max_word": 40, "separator": " " }, } ] }; const mockTabInfo = { title: "test", uri: "www.test.com", name: "Tab test", username: "test@passbolt.com", secret_clear: "password test" }; export const mockResults = { "passbolt.quickaccess.prepare-resource": mockTabInfo, "passbolt.resources.create": {} };