html-reporter
Advanced tools
Comparing version 2.10.1 to 2.11.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.11.0"></a> | ||
# [2.11.0](https://github.com/gemini-testing/html-reporter/compare/v2.10.1...v2.11.0) (2018-04-04) | ||
### Features | ||
* add "scaleImages" option ([e5371aa](https://github.com/gemini-testing/html-reporter/commit/e5371aa)) | ||
<a name="2.10.1"></a> | ||
@@ -7,0 +17,0 @@ ## [2.10.1](https://github.com/gemini-testing/html-reporter/compare/v2.10.0...v2.10.1) (2018-04-04) |
@@ -13,9 +13,11 @@ 'use strict'; | ||
const isString = (name) => { | ||
const assertType = (name, validationFn, type) => { | ||
return (v) => { | ||
if (!_.isString(v)) { | ||
throw new Error(`"${name}" option must be string, but got ${typeof v}`); | ||
if (!validationFn(v)) { | ||
throw new Error(`"${name}" option must be ${type}, but got ${typeof v}`); | ||
} | ||
}; | ||
}; | ||
const assertString = (name) => assertType(name, _.isString, 'string'); | ||
const assertBoolean = (name) => assertType(name, _.isBoolean, 'boolean'); | ||
@@ -28,19 +30,21 @@ const getParser = () => { | ||
parseCli: JSON.parse, | ||
validate: (v) => { | ||
if (!_.isBoolean(v)) { | ||
throw new Error(`"enabled" option must be boolean, but got ${typeof v}`); | ||
} | ||
} | ||
validate: assertBoolean('enabled') | ||
}), | ||
path: option({ | ||
defaultValue: 'html-report', | ||
validate: isString('path') | ||
validate: assertString('path') | ||
}), | ||
defaultView: option({ | ||
defaultValue: 'all', | ||
validate: isString('defaultView') | ||
validate: assertString('defaultView') | ||
}), | ||
baseHost: option({ | ||
defaultValue: '', | ||
validate: isString('baseHost') | ||
validate: assertString('baseHost') | ||
}), | ||
scaleImages: option({ | ||
defaultValue: false, | ||
parseEnv: JSON.parse, | ||
parseCli: JSON.parse, | ||
validate: assertBoolean('scaleImages') | ||
}) | ||
@@ -47,0 +51,0 @@ }), {envPrefix: ENV_PREFIX, cliPrefix: CLI_PREFIX}); |
@@ -185,3 +185,3 @@ 'use strict'; | ||
getResult() { | ||
const {defaultView, baseHost} = this._pluginConfig; | ||
const {defaultView, baseHost, scaleImages} = this._pluginConfig; | ||
@@ -191,3 +191,3 @@ return _.extend({ | ||
suites: this._tree.children, | ||
config: {defaultView, baseHost} | ||
config: {defaultView, baseHost, scaleImages} | ||
}, this._stats); | ||
@@ -194,0 +194,0 @@ } |
@@ -52,3 +52,3 @@ 'use strict'; | ||
label="Scale images" | ||
isActive={view.scaleImages} | ||
isActive={view.scaleImagesPressed} | ||
handler={actions.toggleScaleImages} | ||
@@ -55,0 +55,0 @@ /> |
@@ -15,3 +15,3 @@ 'use strict'; | ||
showOnlyDiff: PropTypes.bool.isRequired, | ||
scaleImages: PropTypes.bool.isRequired | ||
scaleImagesPressed: PropTypes.bool.isRequired | ||
} | ||
@@ -23,3 +23,3 @@ | ||
'image-box__container', | ||
{'image-box__container_scale': this.props.scaleImages} | ||
{'image-box__container_scale': this.props.scaleImagesPressed} | ||
); | ||
@@ -61,4 +61,4 @@ | ||
showOnlyDiff: view.showOnlyDiff, | ||
scaleImages: view.scaleImages | ||
scaleImagesPressed: view.scaleImagesPressed | ||
}) | ||
)(StateFail); |
@@ -15,2 +15,3 @@ 'use strict'; | ||
defaultView: 'all', | ||
scaleImages: false, | ||
baseHost: '' | ||
@@ -33,5 +34,5 @@ }, | ||
showOnlyDiff: false, | ||
scaleImages: false, | ||
scaleImagesPressed: false, | ||
baseHost: '' | ||
} | ||
}; |
@@ -24,2 +24,3 @@ 'use strict'; | ||
viewMode: config.defaultView, | ||
scaleImagesPressed: config.scaleImages, | ||
..._loadBaseHost(config.baseHost, localStorage) | ||
@@ -33,6 +34,6 @@ } | ||
case actionNames.VIEW_INITIAL: { | ||
const {gui, autoRun, suites, skips} = action.payload; | ||
const {gui, autoRun, suites, skips, config: {scaleImages}} = action.payload; | ||
const formattedSuites = formatSuitesData(suites); | ||
return merge({}, state, {gui, autoRun, skips}, formattedSuites); | ||
return merge({}, state, {gui, autoRun, skips, view: {scaleImagesPressed: scaleImages}}, formattedSuites); | ||
} | ||
@@ -105,3 +106,3 @@ case actionNames.RUN_ALL_TESTS: { | ||
case actionNames.VIEW_TOGGLE_SCALE_IMAGES: { | ||
return _mutateStateView(state, {scaleImages: !state.view.scaleImages}); | ||
return _mutateStateView(state, {scaleImagesPressed: !state.view.scaleImagesPressed}); | ||
} | ||
@@ -108,0 +109,0 @@ case actionNames.VIEW_UPDATE_BASE_HOST: { |
{ | ||
"name": "html-reporter", | ||
"version": "2.10.1", | ||
"version": "2.11.0", | ||
"description": "Plugin for gemini and hermione which is intended to aggregate the results of tests running into html report", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -25,2 +25,3 @@ # html-reporter | ||
* **baseHost** (optional) - `String` - it changes original host for view in the browser; by default original host does not change | ||
* **scaleImages** (optional) – `Boolean` – fit images into page width; `false` by default | ||
@@ -27,0 +28,0 @@ Also there is ability to override plugin parameters by CLI options or environment variables |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90
1370926
6999
1