Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return Promise.resolve().then(() => {
const inputFields = shadowQuerySelectorAll(
element,
'lightning-input-field,lightning-output-field'
);
expect(inputFields[0].fieldName).toBe('Name');
});
});
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);
});
});
return Promise.resolve().then(() => {
const buttons = shadowQuerySelectorAll(
element,
'lightning-button-icon'
);
const outputFields = shadowQuerySelectorAll(
element,
'lightning-output-field'
);
checkNodeListLength(outputFields, 1);
checkNodeListLength(buttons, 0);
});
});
return Promise.resolve().then(() => {
const inputFields = shadowQuerySelectorAll(
element,
'lightning-input-field'
);
expect(inputFields[0].fieldName).toBe('Name');
});
});
return Promise.resolve().then(() => {
const buttons = shadowQuerySelectorAll(
element,
'lightning-button-icon'
);
const outputFields = shadowQuerySelectorAll(
element,
'lightning-output-field'
);
checkNodeListLength(outputFields, 1);
checkNodeListLength(buttons, 0);
});
});
return Promise.resolve().then(() => {
const outputFields = shadowQuerySelectorAll(
element,
'lightning-button-icon'
);
const length = outputFields.length;
expect(length).toEqual(2);
});
});
return Promise.resolve().then(() => {
const inputFields = shadowQuerySelectorAll(
element,
'lightning-input-field'
);
const outputFields = shadowQuerySelectorAll(
element,
'lightning-output-field'
);
checkNodeListLength(inputFields, 1);
checkNodeListLength(outputFields, 1);
});
});
return Promise.resolve().then(() => {
const inputFields = shadowQuerySelectorAll(
element,
'lightning-input-field,lightning-output-field'
);
expect(inputFields).toHaveLength(2);
});
});
return Promise.resolve().then(() => {
const outputFields = shadowQuerySelectorAll(
element,
'lightning-output-field'
);
const length = outputFields.length;
expect(length).toEqual(1);
});
});