-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reporting config page create and delete bugs
- Loading branch information
1 parent
79647fc
commit db2afef
Showing
4 changed files
with
66 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import ReportingConfig from './index'; | ||
|
||
const defaultProps = { | ||
location: { | ||
state: { hasRequestedCodes: true }, | ||
}, | ||
match: { path: 'foobar' }, | ||
history: { replace: jest.fn() }, | ||
enterpriseId: 'enterpriseFoobar', | ||
}; | ||
|
||
describe('<ReportingConfig /> ', () => { | ||
it('properly removes forms on delete', () => { | ||
const wrapper = mount(<ReportingConfig {...defaultProps} />); | ||
const configUuidToDelete = 'fake enterprise uuid'; | ||
wrapper.setState( | ||
{ | ||
reportingConfigs: [ | ||
{ uuid: configUuidToDelete }, | ||
{ uuid: 'foo' }, | ||
{ uuid: 'bar' }, | ||
], | ||
}, | ||
); | ||
// Make sure deleteConfig doesn't blow things up | ||
wrapper.instance().deleteConfig(configUuidToDelete); | ||
}); | ||
}); |