@coorpacademy/components 10.13.2 → 10.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/select/index.js +4 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/course-sections/test/fixtures.js +0 -2
- package/es/molecule/course-sections/test/fixtures.js.map +1 -1
- package/lib/atom/select/index.js +4 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/course-sections/test/fixtures.js +0 -3
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -1
- package/package.json +2 -2
- package/es/atom/checkbox-with-title/test/fixtures.js +0 -15
- package/es/atom/checkbox-with-title/test/fixtures.js.map +0 -1
- package/es/atom/input-text-with-title/test/fixtures.js +0 -15
- package/es/atom/input-text-with-title/test/fixtures.js.map +0 -1
- package/es/molecule/dashboard/review-banner/test/fixtures.js +0 -13
- package/es/molecule/dashboard/review-banner/test/fixtures.js.map +0 -1
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +0 -15
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +0 -1
- package/es/molecule/review-correction-popin/test/fixtures.js +0 -15
- package/es/molecule/review-correction-popin/test/fixtures.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/atom/checkbox-with-title/test/fixtures.js +0 -25
- package/lib/atom/checkbox-with-title/test/fixtures.js.map +0 -1
- package/lib/atom/input-text-with-title/test/fixtures.js +0 -25
- package/lib/atom/input-text-with-title/test/fixtures.js.map +0 -1
- package/lib/molecule/dashboard/review-banner/test/fixtures.js +0 -22
- package/lib/molecule/dashboard/review-banner/test/fixtures.js.map +0 -1
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +0 -25
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +0 -1
- package/lib/molecule/review-correction-popin/test/fixtures.js +0 -25
- package/lib/molecule/review-correction-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
package/es/atom/select/index.js
CHANGED
|
@@ -99,7 +99,10 @@ const Select = (props, context) => {
|
|
|
99
99
|
className: style.selectWrapper
|
|
100
100
|
}, titleView, /*#__PURE__*/React.createElement("span", {
|
|
101
101
|
"data-name": "select-span",
|
|
102
|
-
className: classnames(style.selectSpan, includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? style.noLabelCommon : null, borderClassName, isLongLabel ? style.longLabel : null)
|
|
102
|
+
className: classnames(style.selectSpan, includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? style.noLabelCommon : null, borderClassName, isLongLabel ? style.longLabel : null),
|
|
103
|
+
style: _extends({}, shouldUseSkinFontColor && {
|
|
104
|
+
color
|
|
105
|
+
})
|
|
103
106
|
}, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", {
|
|
104
107
|
"data-name": "native-select",
|
|
105
108
|
className: style.selectBox,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7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AAV,CAAoB,CAAC/E,SAAS,CAAC6E,MAAX,EAAmB7E,SAAS,CAACgF,MAA7B,CAApB,CAF4B;AAGnC/B,EAAAA,QAAQ,EAAEjD,SAAS,CAACiF,IAHe;AAInC7B,EAAAA,WAAW,EAAEpD,SAAS,CAACiF;AAJY,CAA9B;AAOPxD,MAAM,CAACyD,YAAP,GAAsB;AACpBxC,EAAAA,IAAI,EAAE9B,QAAQ,CAACuE,iBAAT,CAA2BzC;AADb,CAAtB;AAIAjB,MAAM,CAAC2D,SAAP,2CAAmB;AACjB5C,EAAAA,KAAK,EAAExC,SAAS,CAAC6E,MADA;AAEjBjD,EAAAA,IAAI,EAAE5B,SAAS,CAAC6E,MAFC;AAGjB/C,EAAAA,SAAS,EAAE9B,SAAS,CAAC6E,MAHJ;AAIjB9C,EAAAA,eAAe,EAAE/B,SAAS,CAAC6E,MAJV;AAKjB3C,EAAAA,QAAQ,EAAElC,SAAS,CAACiF,IALH;AAMjBhD,EAAAA,QAAQ,EAAEjC,SAAS,CAACiF,IANH;AAOjB7C,EAAAA,WAAW,EAAEpC,SAAS,CAAC6E,MAPN;AAQjB1C,EAAAA,QAAQ,EAAEnC,SAAS,CAACiF,IARH;AASjBjD,EAAAA,QAAQ,EAAEhC,SAAS,CAACqF,IATH;AAUjBhD,EAAAA,KAAK,EAAErC,SAAS,CAACsF,KAAV,CAAgB/E,IAAI,CAACQ,UAAD,CAApB,CAVU;AAWjBc,EAAAA,OAAO,EAAE7B,SAAS,CAACuF,OAAV,CAAkBvF,SAAS,CAACwF,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;AAYjBtC,EAAAA,QAAQ,EAAEtC,SAAS,CAACiF,IAZH;AAajB1C,EAAAA,KAAK,EAAEvC,SAAS,CAACiF;AAbA,CAAnB;AAgBA,eAAexD,MAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,4BA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AAS,CAAC6E,MADA;AAEjBjD,EAAAA,IAAI,EAAE5B,SAAS,CAAC6E,MAFC;AAGjB/C,EAAAA,SAAS,EAAE9B,SAAS,CAAC6E,MAHJ;AAIjB9C,EAAAA,eAAe,EAAE/B,SAAS,CAAC6E,MAJV;AAKjB3C,EAAAA,QAAQ,EAAElC,SAAS,CAACiF,IALH;AAMjBhD,EAAAA,QAAQ,EAAEjC,SAAS,CAACiF,IANH;AAOjB7C,EAAAA,WAAW,EAAEpC,SAAS,CAAC6E,MAPN;AAQjB1C,EAAAA,QAAQ,EAAEnC,SAAS,CAACiF,IARH;AASjBjD,EAAAA,QAAQ,EAAEhC,SAAS,CAACqF,IATH;AAUjBhD,EAAAA,KAAK,EAAErC,SAAS,CAACsF,KAAV,CAAgB/E,IAAI,CAACQ,UAAD,CAApB,CAVU;AAWjBc,EAAAA,OAAO,EAAE7B,SAAS,CAACuF,OAAV,CAAkBvF,SAAS,CAACwF,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;AAYjBtC,EAAAA,QAAQ,EAAEtC,SAAS,CAACiF,IAZH;AAajB1C,EAAAA,KAAK,EAAEvC,SAAS,CAACiF;AAbA,CAAnB;AAgBA,eAAexD,MAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
@@ -4,7 +4,6 @@ import renderComponentMacro from '../../../test/helpers/render-component';
|
|
|
4
4
|
import MoleculeCourseSections from '..';
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureLoading from './fixtures/loading';
|
|
7
|
-
import fixtureWithMandatoryCoursesInput from './fixtures/with-mandatory-courses-input';
|
|
8
7
|
test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
|
|
9
8
|
t.pass();
|
|
10
9
|
forEach(MoleculeCourseSections.propTypes, (value, key) => {
|
|
@@ -13,5 +12,4 @@ test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
|
|
|
13
12
|
});
|
|
14
13
|
test('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);
|
|
15
14
|
test('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);
|
|
16
|
-
test('Molecule › MoleculeCourseSections › WithMandatoryCoursesInput › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureWithMandatoryCoursesInput);
|
|
17
15
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSections","fixtureDefault","fixtureLoading","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSections","fixtureDefault","fixtureLoading","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,sBAAP,MAAmC,IAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAL,IAAI,CAAC,iEAAD,EAAoEM,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,sBAAsB,CAACK,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHC,cAAnH,CAAJ;AACAJ,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHE,cAAnH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSections from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\n\ntest('Molecule › MoleculeCourseSections > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSections.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSections.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);\ntest('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);\n"],"file":"fixtures.js"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -125,7 +125,10 @@ const Select = (props, context) => {
|
|
|
125
125
|
className: _style.default.selectWrapper
|
|
126
126
|
}, titleView, /*#__PURE__*/_react.default.createElement("span", {
|
|
127
127
|
"data-name": "select-span",
|
|
128
|
-
className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null)
|
|
128
|
+
className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null),
|
|
129
|
+
style: _extends({}, shouldUseSkinFontColor && {
|
|
130
|
+
color
|
|
131
|
+
})
|
|
129
132
|
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", {
|
|
130
133
|
"data-name": "native-select",
|
|
131
134
|
className: _style.default.selectBox,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEC,eAAMD,MADG;AAEjBE,EAAAA,OAAO,EAAED,eAAMC,OAFE;AAGjBC,EAAAA,MAAM,EAAEF,eAAME,MAHG;AAIjBC,EAAAA,IAAI,EAAEH,eAAMG,IAJK;AAKjBC,EAAAA,QAAQ,EAAEJ,eAAMI,QALC;AAMjBC,EAAAA,IAAI,EAAEL,eAAMK,IANK;AAOjBC,EAAAA,WAAW,EAAEN,eAAMM,WAPF;AAQjBC,EAAAA,MAAM,EAAEP,eAAMO,MARG;AASjBC,EAAAA,QAAQ,EAAER,eAAMQ,QATC;AAUjBC,EAAAA,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC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,EAAEyB,mBAAUK;AAJY,CAA9B;;AAOP1D,MAAM,CAAC2D,YAAP,GAAsB;AACpB1C,EAAAA,IAAI,EAAE2C,kBAASC,iBAAT,CAA2B5C;AADb,CAAtB;AAIAjB,MAAM,CAAC8D,SAAP,2CAAmB;AACjB/C,EAAAA,KAAK,EAAEsC,mBAAUC,MADA;AAEjBnD,EAAAA,IAAI,EAAEkD,mBAAUC,MAFC;AAGjBjD,EAAAA,SAAS,EAAEgD,mBAAUC,MAHJ;AAIjBhD,EAAAA,eAAe,EAAE+C,mBAAUC,MAJV;AAKjB7C,EAAAA,QAAQ,EAAE4C,mBAAUK,IALH;AAMjBlD,EAAAA,QAAQ,EAAE6C,mBAAUK,IANH;AAOjB/C,EAAAA,WAAW,EAAE0C,mBAAUC,MAPN;AAQjB5C,EAAAA,QAAQ,EAAE2C,mBAAUK,IARH;AASjBnD,EAAAA,QAAQ,EAAE8C,mBAAUU,IATH;AAUjBnD,EAAAA,KAAK,EAAEyC,mBAAUW,KAAV,CAAgB,mBAAK5E,UAAL,CAAhB,CAVU;AAWjBgB,EAAAA,OAAO,EAAEiD,mBAAUY,OAAV,CAAkBZ,mBAAUa,KAAV,CAAgBd,qBAAhB,CAAlB,CAXQ;AAYjBvC,EAAAA,QAAQ,EAAEwC,mBAAUK,IAZH;AAajB5C,EAAAA,KAAK,EAAEuC,mBAAUK;AAbA,CAAnB;eAgBe1D,M","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEC,eAAMD,MADG;AAEjBE,EAAAA,OAAO,EAAED,eAAMC,OAFE;AAGjBC,EAAAA,MAAM,EAAEF,eAAME,MAHG;AAIjBC,EAAAA,IAAI,EAAEH,eAAMG,IAJK;AAKjBC,EAAAA,QAAQ,EAAEJ,eAAMI,QALC;AAMjBC,EAAAA,IAAI,EAAEL,eAAMK,IANK;AAOjBC,EAAAA,WAAW,EAAEN,eAAMM,WAPF;AAQjBC,EAAAA,MAAM,EAAEP,eAAMO,MARG;AASjBC,EAAAA,QAAQ,EAAER,eAAMQ,QATC;AAUjBC,EAAAA,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACjC,QAAM;AACJC,IAAAA,IADI;AAEJC,IAAAA,OAAO,GAAG,EAFN;AAGJC,IAAAA,SAHI;AAIJC,IAAAA,eAJI;AAKJC,IAAAA,QALI;AAMJC,IAAAA,QAAQ,GAAG,KANP;AAOJC,IAAAA,QAPI;AAQJC,IAAAA,QARI;AASJC,IA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D,SAAP,2CAAmB;AACjB/C,EAAAA,KAAK,EAAEsC,mBAAUC,MADA;AAEjBnD,EAAAA,IAAI,EAAEkD,mBAAUC,MAFC;AAGjBjD,EAAAA,SAAS,EAAEgD,mBAAUC,MAHJ;AAIjBhD,EAAAA,eAAe,EAAE+C,mBAAUC,MAJV;AAKjB7C,EAAAA,QAAQ,EAAE4C,mBAAUK,IALH;AAMjBlD,EAAAA,QAAQ,EAAE6C,mBAAUK,IANH;AAOjB/C,EAAAA,WAAW,EAAE0C,mBAAUC,MAPN;AAQjB5C,EAAAA,QAAQ,EAAE2C,mBAAUK,IARH;AASjBnD,EAAAA,QAAQ,EAAE8C,mBAAUU,IATH;AAUjBnD,EAAAA,KAAK,EAAEyC,mBAAUW,KAAV,CAAgB,mBAAK5E,UAAL,CAAhB,CAVU;AAWjBgB,EAAAA,OAAO,EAAEiD,mBAAUY,OAAV,CAAkBZ,mBAAUa,KAAV,CAAgBd,qBAAhB,CAAlB,CAXQ;AAYjBvC,EAAAA,QAAQ,EAAEwC,mBAAUK,IAZH;AAajB5C,EAAAA,KAAK,EAAEuC,mBAAUK;AAbA,CAAnB;eAgBe1D,M","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
@@ -12,8 +12,6 @@ var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
|
12
12
|
|
|
13
13
|
var _loading = _interopRequireDefault(require("./fixtures/loading"));
|
|
14
14
|
|
|
15
|
-
var _withMandatoryCoursesInput = _interopRequireDefault(require("./fixtures/with-mandatory-courses-input"));
|
|
16
|
-
|
|
17
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
16
|
|
|
19
17
|
(0, _ava.default)('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
|
|
@@ -24,5 +22,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
24
22
|
});
|
|
25
23
|
(0, _ava.default)('Molecule › MoleculeCourseSections › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
26
24
|
(0, _ava.default)('Molecule › MoleculeCourseSections › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
|
|
27
|
-
(0, _ava.default)('Molecule › MoleculeCourseSections › WithMandatoryCoursesInput › should be rendered', _renderComponent.default, _.default, _withMandatoryCoursesInput.default);
|
|
28
25
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["t","pass","MoleculeCourseSections","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureLoading"
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["t","pass","MoleculeCourseSections","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureLoading"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,kEAAL,EAAyEG,wBAAzE,EAA+FN,SAA/F,EAAuHO,gBAAvH;AACA,kBAAK,kEAAL,EAAyED,wBAAzE,EAA+FN,SAA/F,EAAuHQ,gBAAvH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSections from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\n\ntest('Molecule › MoleculeCourseSections > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSections.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSections.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);\ntest('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);\n"],"file":"fixtures.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.13.
|
|
3
|
+
"version": "10.13.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"webpack-hot-middleware": "^2.25.0"
|
|
120
120
|
},
|
|
121
121
|
"author": "CoorpAcademy",
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "cd486f415b9f474cf22e788125dc9b5dc44da169"
|
|
123
123
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import AtomCheckboxWithTitle from '..';
|
|
5
|
-
import fixtureChecked from './fixtures/checked';
|
|
6
|
-
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
-
test('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Atom.AtomCheckboxWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);
|
|
14
|
-
test('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/checkbox-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomCheckboxWithTitle","fixtureChecked","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,4DAAD,EAA+DM,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,qBAAqB,CAACK,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,qBAAtF,EAA6GC,cAA7G,CAAJ;AACAJ,IAAI,CAAC,+DAAD,EAAkEE,oBAAlE,EAAwFC,qBAAxF,EAA+GE,gBAA/G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCheckboxWithTitle from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCheckboxWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);\ntest('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import AtomInputTextWithTitle from '..';
|
|
5
|
-
import fixtureDefault from './fixtures/default';
|
|
6
|
-
import fixtureError from './fixtures/error';
|
|
7
|
-
test('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(AtomInputTextWithTitle.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Atom.AtomInputTextWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);
|
|
14
|
-
test('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/input-text-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputTextWithTitle","fixtureDefault","fixtureError","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,sBAAP,MAAmC,IAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAL,IAAI,CAAC,6DAAD,EAAgEM,CAAC,IAAI;AACvEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,sBAAsB,CAACK,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uDAAsDF,GAAI,mEAAnF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,sBAAvF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,sBAArF,EAA6GE,YAA7G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomInputTextWithTitle from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureError from './fixtures/error';\n\ntest('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputTextWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputTextWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);\ntest('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);\n"],"file":"fixtures.js"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeDashboardReviewBanner from '..';
|
|
5
|
-
import fixtureDefault from './fixtures/default';
|
|
6
|
-
test('MoleculeDashboard › MoleculeDashboardReviewBanner > should have valid propTypes', t => {
|
|
7
|
-
t.pass();
|
|
8
|
-
forEach(MoleculeDashboardReviewBanner.propTypes, (value, key) => {
|
|
9
|
-
t.not(value, undefined, `PropType for "MoleculeDashboard.MoleculeDashboardReviewBanner.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
test('MoleculeDashboard › MoleculeDashboardReviewBanner › Default › should be rendered', renderComponentMacro, MoleculeDashboardReviewBanner, fixtureDefault);
|
|
13
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/dashboard/review-banner/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDashboardReviewBanner","fixtureDefault","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,2CAAjC;AACA,OAAOC,6BAAP,MAA0C,IAA1C;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAJ,IAAI,CAAC,iFAAD,EAAoFK,CAAC,IAAI;AAC3FA,EAAAA,CAAC,CAACC,IAAF;AACAL,EAAAA,OAAO,CAACE,6BAA6B,CAACI,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2EAA0EF,GAAI,mEAAvG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAT,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,6BAA3G,EAA0IC,cAA1I,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport MoleculeDashboardReviewBanner from '..';\nimport fixtureDefault from './fixtures/default';\n\ntest('MoleculeDashboard › MoleculeDashboardReviewBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDashboardReviewBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"MoleculeDashboard.MoleculeDashboardReviewBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('MoleculeDashboard › MoleculeDashboardReviewBanner › Default › should be rendered', renderComponentMacro, MoleculeDashboardReviewBanner, fixtureDefault);\n"],"file":"fixtures.js"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeInputTextWithTiteledCheckbox from '..';
|
|
5
|
-
import fixtureChecked from './fixtures/checked';
|
|
6
|
-
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
-
test('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);
|
|
14
|
-
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/input-text-with-titeled-checkbox/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeInputTextWithTiteledCheckbox","fixtureChecked","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oCAAP,MAAiD,IAAjD;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,+EAAD,EAAkFM,CAAC,IAAI;AACzFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,oCAAoC,CAACK,SAAtC,EAAiD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtEJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yEAAwEF,GAAI,mEAArG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,oCAAzG,EAA+IC,cAA/I,CAAJ;AACAJ,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,oCAA3G,EAAiJE,gBAAjJ,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeInputTextWithTiteledCheckbox from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeReviewCorrectionPopin from '..';
|
|
5
|
-
import fixtureRight from './fixtures/right';
|
|
6
|
-
import fixtureWrong from './fixtures/wrong';
|
|
7
|
-
test('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(MoleculeReviewCorrectionPopin.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureRight);
|
|
14
|
-
test('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureWrong);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/review-correction-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeReviewCorrectionPopin","fixtureRight","fixtureWrong","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,6BAAP,MAA0C,IAA1C;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAL,IAAI,CAAC,wEAAD,EAA2EM,CAAC,IAAI;AAClFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,6BAA6B,CAACK,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kEAAiEF,GAAI,mEAA9F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,6BAAhG,EAA+HC,YAA/H,CAAJ;AACAJ,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,6BAAhG,EAA+HE,YAA/H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeReviewCorrectionPopin from '..';\nimport fixtureRight from './fixtures/right';\nimport fixtureWrong from './fixtures/wrong';\n\ntest('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeReviewCorrectionPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureRight);\ntest('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureWrong);\n"],"file":"fixtures.js"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeSearch from '..';
|
|
5
|
-
import fixtureDefault from './fixtures/default';
|
|
6
|
-
import fixtureWithValue from './fixtures/with-value';
|
|
7
|
-
test('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(MoleculeSearch.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);
|
|
14
|
-
test('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSearch","fixtureDefault","fixtureWithValue","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAL,IAAI,CAAC,yDAAD,EAA4DM,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,cAAnF,EAAmGC,cAAnG,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,cAArF,EAAqGE,gBAArG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _checked = _interopRequireDefault(require("./fixtures/checked"));
|
|
12
|
-
|
|
13
|
-
var _unchecked = _interopRequireDefault(require("./fixtures/unchecked"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Atom.AtomCheckboxWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Atom › AtomCheckboxWithTitle › Checked › should be rendered', _renderComponent.default, _.default, _checked.default);
|
|
24
|
-
(0, _ava.default)('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', _renderComponent.default, _.default, _unchecked.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/checkbox-with-title/test/fixtures.js"],"names":["t","pass","AtomCheckboxWithTitle","propTypes","value","key","not","undefined","renderComponentMacro","fixtureChecked","fixtureUnchecked"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,4DAAL,EAAmEA,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,6DAAL,EAAoEG,wBAApE,EAA0FN,SAA1F,EAAiHO,gBAAjH;AACA,kBAAK,+DAAL,EAAsED,wBAAtE,EAA4FN,SAA5F,EAAmHQ,kBAAnH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCheckboxWithTitle from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCheckboxWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);\ntest('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
-
|
|
13
|
-
var _error = _interopRequireDefault(require("./fixtures/error"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Atom.AtomInputTextWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Atom › AtomInputTextWithTitle › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
-
(0, _ava.default)('Atom › AtomInputTextWithTitle › Error › should be rendered', _renderComponent.default, _.default, _error.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/input-text-with-title/test/fixtures.js"],"names":["t","pass","AtomInputTextWithTitle","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureError"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,6DAAL,EAAoEA,CAAC,IAAI;AACvEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uDAAsDF,GAAI,mEAAnF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,8DAAL,EAAqEG,wBAArE,EAA2FN,SAA3F,EAAmHO,gBAAnH;AACA,kBAAK,4DAAL,EAAmED,wBAAnE,EAAyFN,SAAzF,EAAiHQ,cAAjH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomInputTextWithTitle from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureError from './fixtures/error';\n\ntest('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputTextWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputTextWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);\ntest('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);\n"],"file":"fixtures.js"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
(0, _ava.default)('MoleculeDashboard › MoleculeDashboardReviewBanner > should have valid propTypes', t => {
|
|
16
|
-
t.pass();
|
|
17
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
18
|
-
t.not(value, undefined, `PropType for "MoleculeDashboard.MoleculeDashboardReviewBanner.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
(0, _ava.default)('MoleculeDashboard › MoleculeDashboardReviewBanner › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
22
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/dashboard/review-banner/test/fixtures.js"],"names":["t","pass","MoleculeDashboardReviewBanner","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iFAAL,EAAwFA,CAAC,IAAI;AAC3FA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAA8BC,SAAtC,EAAiD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2EAA0EF,GAAI,mEAAvG;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,kFAAL,EAAyFG,wBAAzF,EAA+GN,SAA/G,EAA8IO,gBAA9I","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport MoleculeDashboardReviewBanner from '..';\nimport fixtureDefault from './fixtures/default';\n\ntest('MoleculeDashboard › MoleculeDashboardReviewBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDashboardReviewBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"MoleculeDashboard.MoleculeDashboardReviewBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('MoleculeDashboard › MoleculeDashboardReviewBanner › Default › should be rendered', renderComponentMacro, MoleculeDashboardReviewBanner, fixtureDefault);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _checked = _interopRequireDefault(require("./fixtures/checked"));
|
|
12
|
-
|
|
13
|
-
var _unchecked = _interopRequireDefault(require("./fixtures/unchecked"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', _renderComponent.default, _.default, _checked.default);
|
|
24
|
-
(0, _ava.default)('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', _renderComponent.default, _.default, _unchecked.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/input-text-with-titeled-checkbox/test/fixtures.js"],"names":["t","pass","MoleculeInputTextWithTiteledCheckbox","propTypes","value","key","not","undefined","renderComponentMacro","fixtureChecked","fixtureUnchecked"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,+EAAL,EAAsFA,CAAC,IAAI;AACzFA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAqCC,SAA7C,EAAwD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtEL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yEAAwEF,GAAI,mEAArG;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,gFAAL,EAAuFG,wBAAvF,EAA6GN,SAA7G,EAAmJO,gBAAnJ;AACA,kBAAK,kFAAL,EAAyFD,wBAAzF,EAA+GN,SAA/G,EAAqJQ,kBAArJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeInputTextWithTiteledCheckbox from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _right = _interopRequireDefault(require("./fixtures/right"));
|
|
12
|
-
|
|
13
|
-
var _wrong = _interopRequireDefault(require("./fixtures/wrong"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', _renderComponent.default, _.default, _right.default);
|
|
24
|
-
(0, _ava.default)('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', _renderComponent.default, _.default, _wrong.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/review-correction-popin/test/fixtures.js"],"names":["t","pass","MoleculeReviewCorrectionPopin","propTypes","value","key","not","undefined","renderComponentMacro","fixtureRight","fixtureWrong"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,wEAAL,EAA+EA,CAAC,IAAI;AAClFA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAA8BC,SAAtC,EAAiD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kEAAiEF,GAAI,mEAA9F;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,uEAAL,EAA8EG,wBAA9E,EAAoGN,SAApG,EAAmIO,cAAnI;AACA,kBAAK,uEAAL,EAA8ED,wBAA9E,EAAoGN,SAApG,EAAmIQ,cAAnI","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeReviewCorrectionPopin from '..';\nimport fixtureRight from './fixtures/right';\nimport fixtureWrong from './fixtures/wrong';\n\ntest('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeReviewCorrectionPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureRight);\ntest('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureWrong);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
-
|
|
13
|
-
var _withValue = _interopRequireDefault(require("./fixtures/with-value"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Molecule › MoleculeSearch › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
-
(0, _ava.default)('Molecule › MoleculeSearch › WithValue › should be rendered', _renderComponent.default, _.default, _withValue.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["t","pass","MoleculeSearch","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithValue"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,4DAAL,EAAmED,wBAAnE,EAAyFN,SAAzF,EAAyGQ,kBAAzG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|