mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-03-25 20:29:45 -04:00
mocked event in simulated click
This commit is contained in:
parent
a6cca54647
commit
8c30051bdc
1 changed files with 3 additions and 2 deletions
|
@ -42,7 +42,8 @@ describe('Navigation', () => {
|
|||
const navWrapper = getNavigationWrapper(props);
|
||||
const navInstance = navWrapper.instance();
|
||||
|
||||
navWrapper.find('a.registrationLink').simulate('click');
|
||||
// simulate click, with mocked event
|
||||
navWrapper.find('a.registrationLink').simulate('click', {preventDefault () {}});
|
||||
expect(navInstance.props.handleRegistrationRequested).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
@ -64,7 +65,7 @@ describe('Navigation', () => {
|
|||
const navWrapper = getNavigationWrapper(props);
|
||||
const navInstance = navWrapper.instance();
|
||||
|
||||
navWrapper.find('a.registrationLink').simulate('click');
|
||||
navWrapper.find('a.registrationLink').simulate('click', {preventDefault () {}});
|
||||
expect(navInstance.props.handleRegistrationRequested).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue