Skip to content

Commit

Permalink
chore(NOBUG): Increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-wade committed Jan 1, 2024
1 parent 308d22a commit 9b24ef1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/core/tst/api/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,16 @@ describe('render', () => {
render(template)
}).toThrow('Tybalt currently only supports one reactive per attribute. Please consolidate.')
});
});

it('should emit a warning if a placeholder is unexpectedly not found', () => {
const listener = jest.fn();
const template = html`<button type="button" @click="${listener}"></button>`;

jest.spyOn(Element.prototype, 'querySelector').mockImplementation(() => null);
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => '');
render(template)[0];

expect(warnSpy).toHaveBeenCalledTimes(1);
expect(warnSpy.mock.calls[0][0].startsWith('expected to find element with selector ')).toBeTruthy();
});
});

0 comments on commit 9b24ef1

Please sign in to comment.