How to use the lightning/testUtils.shadowQuerySelectorAll function in lightning

To help you get started, we’ve selected a few lightning 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 salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const inputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-input-field,lightning-output-field'
                );

                expect(inputFields[0].fieldName).toBe('Name');
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const inputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-input-field,lightning-output-field'
                );

                const fieldNames = Array.prototype.slice
                    .call(inputFields)
                    .map(field => {
                        return field.fieldName;
                    });
                expect(fieldNames).toEqual(fields);
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const buttons = shadowQuerySelectorAll(
                    element,
                    'lightning-button-icon'
                );

                const outputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-output-field'
                );

                checkNodeListLength(outputFields, 1);
                checkNodeListLength(buttons, 0);
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const inputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-input-field'
                );

                expect(inputFields[0].fieldName).toBe('Name');
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const buttons = shadowQuerySelectorAll(
                    element,
                    'lightning-button-icon'
                );

                const outputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-output-field'
                );

                checkNodeListLength(outputFields, 1);
                checkNodeListLength(buttons, 0);
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const outputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-button-icon'
                );

                const length = outputFields.length;
                expect(length).toEqual(2);
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const inputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-input-field'
                );

                const outputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-output-field'
                );

                checkNodeListLength(inputFields, 1);
                checkNodeListLength(outputFields, 1);
            });
        });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                    const inputFields = shadowQuerySelectorAll(
                        element,
                        'lightning-input-field,lightning-output-field'
                    );

                    expect(inputFields).toHaveLength(2);
                });
            });
github salesforce / base-components-recipes / force-app / main / default / lwc / recordForm / __tests__ / recordForm.spec.js View on Github external
return Promise.resolve().then(() => {
                const outputFields = shadowQuerySelectorAll(
                    element,
                    'lightning-output-field'
                );

                const length = outputFields.length;

                expect(length).toEqual(1);
            });
        });