Skip to content

Commit

Permalink
Expose oneDefaultPreventedEvent from open-wc/testing
Browse files Browse the repository at this point in the history
  • Loading branch information
svanherk committed Aug 28, 2023
1 parent ed89c49 commit c648c06
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, oneEvent, oneDefaultPreventedEvent, 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 c648c06

Please sign in to comment.