<commit_before>({
    fireDomEvent : function (elem, eventType) {
        var ev = new Event(eventType);
        elem.dispatchEvent(ev);
    },
    getInputElement : function (cmp) {
        return cmp.getElement().querySelector('input');
    },
    testChangeEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'change');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('change',lastFiredEvent.getName(),'The last fired event was change.');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');
            }
        ]
    },
    testInputEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'input');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('input',lastFiredEvent.getName(),'The last fired event was input.');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');
            }
        ]
    },
    testKeypressEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'keypress');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('keypress',lastFiredEvent.getName(),'The last fired event was keypress');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');
            }
        ]
    },
    testKeydownEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'keydown');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('keydown',lastFiredEvent.getName(),'The last fired event was keydown');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');
            }
        ]
    },
    testKeyupEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'keyup');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('keyup',lastFiredEvent.getName(),'The last fired event was keyup');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');
            }
        ]
    },
    testCopyEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'copy');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('copy',lastFiredEvent.getName(),'The last fired event was copy');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');
            }
        ]
    },
    testPasteEvent : {
        test : [
            function (cmp) {
                var elem = this.getInputElement(cmp);
                this.fireDomEvent(elem,'paste');
            },
            function (cmp) {
                var lastFiredEvent = cmp.get('v.eventFired');
                var eventCounter = cmp.get('v.eventList').length;
                $A.test.assertEquals('paste',lastFiredEvent.getName(),'The last fired event was paste');
                $A.test.assertEquals(1,eventCounter,'The event counter doesn\'t match');

            }
        ]
    }

})<commit_msg>Fix inputNumber event tests to use .test.fireDomEvent for browser compatibility @bug W-2992363@ @rev bvenkataraman@ @testfix@ @markfixed@<commit_after>({
    testChangeEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'change');
        },function (cmp) {
            this.assertEventFired(cmp, 'change', 1);
        }]
    },

    testInputEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'input');
        },function (cmp) {
            this.assertEventFired(cmp, 'input', 1);
        }]
    },

    testKeypressEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'keypress');
        },function (cmp) {
            this.assertEventFired(cmp, 'keypress', 1);
        }]
    },

    testKeydownEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'keydown');
        },function (cmp) {
            this.assertEventFired(cmp, 'keydown', 1);
        }]
    },

    testKeyupEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'keyup');
        },function (cmp) {
            this.assertEventFired(cmp, 'keyup', 1);
        }]
    },

    testCopyEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'copy');
        },function (cmp) {
            this.assertEventFired(cmp, 'copy', 1);
        }]
    },

    testPasteEvent: {
        test: [function (cmp) {
            var elem = this.getInputElement(cmp);
            $A.test.fireDomEvent(elem, 'paste');
        },function (cmp) {
            this.assertEventFired(cmp, 'paste', 1);
        }]
    },

    getInputElement: function (cmp) {
        return cmp.getElement().getElementsByTagName('input')[0];
    },

    assertEventFired: function (cmp, eventName, eventCounter) {
        $A.test.assertEquals(eventName, cmp.get('v.eventFired').getName(),
                'The last fired event was ' + eventName);
        $A.test.assertEquals(eventCounter, cmp.get('v.eventList').length,
                'The event counter doesn\'t match');
    }
})
{'fraction_non_alphanumeric': 0.1339662447257384, 'fraction_numerical': 0.003315250150693189, 'mean_word_length': 1.7608153078202995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3526946', 'n_tokens_mistral': 1919, 'n_tokens_neox': 1846, 'n_words': 343}