Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme.
Before submitting, please read over our commonly reported issues to prevent duplicates!
If you haven't found any duplicated issues, please report it with your environment!
Current behavior
I'm getting the error in the title. Maybe i'm not setting it up correctly.
I'm looking to update onGetErrorMessage which then checks it what I pass in is valid. IF it is not valid it updates the ariaLabel which is what i'm expected to equal test error.
test('should set error when page number not valid and update aria-label', () => {
const pageChangeCallback = jest.fn().mockName('pageChange callback');
const tree = mount(
<DemoPagination
pageCount={10}
selectedPage={1}
onPageChange={pageChangeCallback}
validationErrorMessageText="test error"
/>
)
const selectedPage = tree.find(TextField);
console.log('PEPE:', tree.props())
console.log('SSSS:', selectedPage.props())
// tree.prop('onGetErrorMessage')('a');
// console.log('III:', selectedPage.setProps({ onGetErrorMessage: onGetErrorMessage('a') }))
// selectedPage.instance()
selectedPage.invoke('onGetErrorMessage')('a');
// selectedPage.props().onGetErrorMessage('a');
console.log('AFFFT:', selectedPage.props())
// selectedPage.props().onGetErrorMessage('a') as any;
const errorMessage = tree.find(Text).at(2);
// console.log('EERR:', errorMessage.props())
expect(errorMessage).toBeDefined();
// expect(selectedPage.prop('ariaLabel')).toContain('test error');
});
Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme. Before submitting, please read over our commonly reported issues to prevent duplicates!
All common issues
Notoriously common issues
If you haven't found any duplicated issues, please report it with your environment!
Current behavior
I'm getting the error in the title. Maybe i'm not setting it up correctly. I'm looking to update
onGetErrorMessage
which then checks it what I pass in is valid. IF it is not valid it updates the ariaLabel which is what i'm expected to equal test error.Expected behavior
For the property function to be called without getting the object which is possibly 'undefined'.
Your environment
API
Version
Adapter