poorejc commented on code in PR #331:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/331#discussion_r1083245162


##########
test/packageLogs_spec.js:
##########
@@ -313,28 +313,15 @@ describe('packageLogs', () => {
     describe('buildPath', () => {
         it('builds a path', () => {
             new JSDOM(``)
+            let actualPath
             const document = window.document;
             const ele = document.createElement('div');
-            const evt = document.createEvent('CustomEvent');
-            evt.initEvent('testEvent', true, true);
+            const evt = new window.Event('CustomEvent', {bubbles: true, 
cancelable: true})
             document.body.appendChild(ele);
+            ele.addEventListener('CustomEvent', e => actualPath = buildPath(e))
             ele.dispatchEvent(evt);
-            expect(buildPath(evt)).to.deep.equal(['div', 'body', 'html']);
-        });
-
-        it('defaults to path if available', () => {
-            new JSDOM(``)
-            const document = window.document;
-            const ele = document.createElement('div');
-            const evt = document.createEvent('CustomEvent');
-            document.body.appendChild(ele);
-            evt.initEvent('testEvent', true, true);
-            ele.dispatchEvent(evt);
-            evt.composedPath = function() {
-                let ele = evt.target;
-                return [ele, ele.parentElement, 
ele.parentElement.parentElement];
-            };
-            expect(buildPath(evt)).to.deep.equal(['div', 'body', 'html']);
+            const expectedPath = ['div', 'body', 'html',   "#document", 
"Window"]

Review Comment:
   @UncleGedd AWESOME. Thanks, Gedd. Was planning some maintenance next week... 
I'll beat on this a bit and report back!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@flagon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to