-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #457 from gemini-testing/HERMIONE-138.steps_reporter
fix: add steps support
- Loading branch information
Showing
17 changed files
with
219 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import {connect} from 'react-redux'; | ||
import PropTypes from 'prop-types'; | ||
import {isEmpty} from 'lodash'; | ||
import Details from '../../../details'; | ||
|
||
import './index.styl'; | ||
|
||
const History = ({history}) => ( | ||
isEmpty(history) | ||
? null | ||
: <Details | ||
title='History' | ||
content={history} | ||
extendClassNames='details_type_text history' | ||
/> | ||
); | ||
|
||
History.propTypes = { | ||
resultId: PropTypes.string.isRequired, | ||
// from store | ||
history: PropTypes.arrayOf(PropTypes.string).isRequired | ||
}; | ||
|
||
export default connect(({tree}, {resultId}) => { | ||
const {history = []} = tree.results.byId[resultId]; | ||
|
||
return {history}; | ||
})(History); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.history { | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import {defaultsDeep, set} from 'lodash'; | ||
import proxyquire from 'proxyquire'; | ||
import {mkConnectedComponent} from '../../utils'; | ||
|
||
describe('<History />', () => { | ||
const sandbox = sinon.sandbox.create(); | ||
let History, Details; | ||
|
||
beforeEach(() => { | ||
Details = sinon.stub().returns(null); | ||
|
||
History = proxyquire('lib/static/components/section/body/history', { | ||
'../../../details': {default: Details} | ||
}).default; | ||
}); | ||
|
||
afterEach(() => sandbox.restore()); | ||
|
||
const mkHistoryComponent = (props = {}, initialState = {}) => { | ||
props = defaultsDeep(props, { | ||
resultId: 'default-result' | ||
}); | ||
|
||
return mkConnectedComponent(<History {...props} />, {initialState}); | ||
}; | ||
|
||
it('should not render if history does not exists', () => { | ||
const initialState = set({}, 'tree.results.byId.default-result', {}); | ||
|
||
mkHistoryComponent({resultId: 'default-result'}, initialState); | ||
|
||
assert.notCalled(Details); | ||
}); | ||
|
||
it('should render history if exists', () => { | ||
const initialState = set({}, 'tree.results.byId.default-result.history', 'some-history'); | ||
|
||
const component = mkHistoryComponent({resultId: 'default-result'}, initialState); | ||
|
||
assert.equal(component.find(Details).prop('content'), 'some-history'); | ||
}); | ||
|
||
it('should render with "History" title', () => { | ||
const initialState = set({}, 'tree.results.byId.default-result.history', 'some-history'); | ||
|
||
const component = mkHistoryComponent({resultId: 'default-result'}, initialState); | ||
|
||
assert.equal(component.find(Details).prop('title'), 'History'); | ||
}); | ||
}); |
Oops, something went wrong.