How to use the @magento/peregrine.useQuery.mockReturnValueOnce function in @magento/peregrine

To help you get started, we’ve selected a few @magento/peregrine 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 Jordaneisenburger / fallback-studio / src / pwa-studio / packages / venia-concept / src / components / SearchBar / __tests__ / autocomplete.spec.js View on Github external
test('renders an empty-set message', () => {
    const data = { products: { filters: [], items: [] } };
    useQuery.mockReturnValueOnce([
        { data, error: null, loading: false },
        queryApi
    ]);

    const { root } = createTestInstance(
        <form>
            
        
    );

    expect(root.findByProps({ className: 'message' }).children).toContain(
        'No results were found.'
    );
});
</form>