How to use the @testing-library/vue.buildQueries function in @testing-library/vue

To help you get started, we’ve selected a few @testing-library/vue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / testing-library__vue / testing-library__vue-tests.ts View on Github external
lib.fireEvent.update(option); // $ExpectType Promise

// Adds touch() function
lib.fireEvent.touch(elem); // $ExpectType Promise

// Reexports async functions from dom-testing-library
lib.wait(); // $ExpectType Promise
lib.wait(() => { throw new Error("nope"); }, {timeout: 3000, interval: 100});
lib.waitForDomChange({container: select, timeout: 3000, mutationObserverOptions: {subtree: false}});
lib.waitForElement(() => input); // $ExpectType Promise
lib.waitForElement(() => option, {container: select, timeout: 3000, mutationObserverOptions: {subtree: false}}); // $ExpectType Promise
lib.waitForElementToBeRemoved(() => input); // $ExpectType Promise
lib.waitForElementToBeRemoved(() => option, {container: select, timeout: 3000, mutationObserverOptions: {subtree: false}}); // $ExpectType Promise

// Reexports utilities from dom-testing-library
lib.buildQueries((el: HTMLElement) => [el], (_: HTMLElement) => "something", (_: HTMLElement) => "error");
lib.within(elem);
lib.getQueriesForElement(elem);
lib.getNodeText(elem); // $ExpectType string
lib.getRoles(elem); // $ExpectType { [index: string]: HTMLElement[]; }
lib.prettyDOM(elem); // $ExpectType string | false
lib.logRoles(elem); // $ExpectType string