@@ -25,27 +25,6 @@ describe('NumberFormat as input', () => {
2525 } ) ;
2626 } ) ;
2727
28- // it('should accept and format custom numerals', () => {
29- // const wrapper = mount(
30- // <NumberFormat customNumerals={['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']} />,
31- // );
32- // simulateKeyInput(wrapper.find('input'), '۱۲۳۴۵۶۷۸۹۰', 0);
33-
34- // expect(getInputValue(wrapper)).toEqual('1234567890');
35- // });
36-
37- // it('should accept and format custom numerals together with format input field', () => {
38- // const wrapper = mount(
39- // <NumberFormat
40- // customNumerals={['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']}
41- // format="##########"
42- // />,
43- // );
44- // simulateKeyInput(wrapper.find('input'), '۱۲۳۴۵۶۷۸۹۰', 0);
45-
46- // expect(getInputValue(wrapper)).toEqual('1234567890');
47- // });
48-
4928 it ( 'should render input as type text by default' , ( ) => {
5029 const wrapper = mount ( < NumericFormat /> ) ;
5130 expect ( wrapper . find ( 'input' ) . instance ( ) . getAttribute ( 'type' ) ) . toEqual ( 'text' ) ;
@@ -553,6 +532,13 @@ describe('NumberFormat as input', () => {
553532 expect ( spy ) . not . toHaveBeenCalled ( ) ;
554533 } ) ;
555534
535+ it ( 'should call onChange if value is changed or reset #669 ' , ( ) => {
536+ const spy = jasmine . createSpy ( 'onChange' ) ;
537+ const wrapper = mount ( < NumericFormat value = { 1 } onChange = { spy } /> ) ;
538+ simulateKeyInput ( wrapper . find ( 'input' ) , 'Backspace' , 1 ) ;
539+ expect ( spy ) . toHaveBeenCalled ( ) ;
540+ } ) ;
541+
556542 describe ( 'Test masking' , ( ) => {
557543 it ( 'should allow mask as string' , ( ) => {
558544 const wrapper = mount ( < PatternFormat format = "#### #### ####" mask = "_" /> ) ;
0 commit comments