Skip to content

Commit

Permalink
test: remove test for removing non-existent listener on custom element
Browse files Browse the repository at this point in the history
  • Loading branch information
ravijayaramappa committed Jan 14, 2020
1 parent c1e836e commit 0fc5937
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createElement } from 'lwc';

import Test from 'x/test';
import LifecycleHooks from 'x/lifecycleHooks';
import NonExistingEventListener from 'x/nonExistingEventListener';

it('should remove existing event listeners', () => {
let isInvoked = false;
Expand Down Expand Up @@ -31,19 +30,3 @@ it('should not throw when invoking in the different lifecycle hooks', () => {
document.body.removeChild(elm);
}).not.toThrow();
});

// TODO [#1043]: inconsistent restriction between native shadow and synthetic shadow
xit('should log an error message when removing a non existing event handler', () => {
const elm = createElement('x-non-existing-event-listener', { is: NonExistingEventListener });

spyOn(console, 'error');
document.body.appendChild(elm);

/* eslint-disable-next-line no-console */
expect(console.error).toHaveBeenCalledTimes(1);

/* eslint-disable-next-line no-console */
expect(console.error.calls.argsFor(0)[0]).toMatch(
/\[LWC error\]: Did not find event listener for event "click" executing removeEventListener on \[object HTMLElement\]. This is probably a typo or a life cycle mismatch. Make sure that you add the right event listeners in the connectedCallback\(\) hook and remove them in the disconnectedCallback\(\) hook./
);
});

This file was deleted.

0 comments on commit 0fc5937

Please sign in to comment.