Skip to content

Commit

Permalink
Fixing console.error leak in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jermnelson committed May 29, 2019
1 parent 2bc2334 commit 0cbde8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions __tests__/components/editor/PropertyComponent.test.js
Expand Up @@ -152,7 +152,7 @@ describe('<PropertyComponent />', () => {
})
})

it('error if <PropertyComponent /> is missing reduxPath props', () => {
it('logs an error if <PropertyComponent /> is missing reduxPath props', () => {
const template = {
"propertyURI": "http://id.loc.gov/ontologies/bibframe/note",
"type": "resource",
Expand All @@ -163,12 +163,12 @@ describe('<PropertyComponent />', () => {
"useValuesFrom": []
}
}
const originalError = console.error
console.error = jest.fn()
const wrapper = shallow(<PropertyComponent index={1}
shallow(<PropertyComponent index={1}
propertyTemplate={template}
rtId={'resourceTemplate:test'} />)
expect(wrapper).toBeTruthy() // Needed to pass eslint
expect(console.error).toHaveBeenCalledTimes(1)

console.error = originalError
})
})

0 comments on commit 0cbde8f

Please sign in to comment.