Skip to content

Commit

Permalink
fix: Expose oneDefaultPreventedEvent from open-wc/testing (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
svanherk authored Aug 28, 2023
1 parent ed89c49 commit d9a37f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ it('should wait for an event', async() => {

Note that the call to `clickElem` is not `await`-ed, since by the time it resolves the event will have already been dispatched.

If you need to prevent the default behaviour of the event in your test, you can use `oneDefaultPreventedEvent`.

#### Waiting for a Lit Element to Update

When using Lit-based components, it's common to create a fixture and then modify some of its properties, which usually requires waiting for those changes to be rendered.
Expand Down
2 changes: 1 addition & 1 deletion src/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './vdiff.js';

export { assert, aTimeout, defineCE, expect, html, nextFrame, oneEvent, waitUntil } from '@open-wc/testing';
export { assert, aTimeout, defineCE, expect, html, nextFrame, oneDefaultPreventedEvent, oneEvent, waitUntil } from '@open-wc/testing';
export { clickAt, clickElem, focusElem, hoverAt, hoverElem, sendKeys, sendKeysElem } from './commands.js';
export { fixture } from './fixture.js';

0 comments on commit d9a37f3

Please sign in to comment.