Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should not have aria-busy when the value is then 0', () => {
const element = createProgressBar({
value: 0
});
const processDiv = shadowQuerySelector(element, '.slds-progress-bar');
expect(processDiv.getAttribute('aria-busy')).toBeNull();
});
it('should not have aria-busy when the value is then 100', () => {
return Promise.resolve().then(() => {
const form = shadowQuerySelector(
element,
'lightning-record-edit-form'
);
element.submit({ foo: 'bar' });
expect(form.getSubmitData()).toEqual({ foo: 'bar' });
});
});
return Promise.resolve().then(() => {
const form = shadowQuerySelector(
element,
'lightning-record-edit-form'
);
form.dispatchEvent(
new CustomEvent('load', {
detail: {
objectInfos: { Lead: store.objectInfo },
layout: store.layouts.Lead.Full.View,
records: store.records
}
})
);
return Promise.resolve().then(() => {
const inputFields = shadowQuerySelectorAll(
return Promise.resolve().then(() => {
const form = shadowQuerySelector(
element,
'lightning-record-edit-form'
);
expect(form.layoutType).toEqual('Full');
});
});
return Promise.resolve().then(() => {
const inputField = shadowQuerySelector(
element,
'lightning-input-field'
);
expect(inputField.value).toBe('initial');
});
});
return Promise.resolve().then(() => {
const el = shadowQuerySelector(
element,
'lightning-button.lightning-record-form-cancel'
);
shadowQuerySelector(element, 'lightning-input-field').value =
'banana';
shadowQuerySelector(el, 'button').click();
return Promise.resolve().then(() => {
const inputField = shadowQuerySelector(
element,
'lightning-input-field'
);
expect(inputField.value).toBe('initial');
});
});
});
return Promise.resolve().then(() => {
const el = shadowQuerySelector(
element,
'lightning-button.lightning-record-form-cancel'
);
shadowQuerySelector(element, 'lightning-input-field').value =
'banana';
shadowQuerySelector(el, 'button').click();
return Promise.resolve().then(() => {
const inputField = shadowQuerySelector(
element,
'lightning-input-field'
);
expect(inputField.value).toBe('initial');
});
});
});
return Promise.resolve().then(() => {
const form = shadowQuerySelector(
element,
'lightning-record-edit-form'
);
expect(form.recordTypeId).toEqual('foo');
});
});
return Promise.resolve().then(() => {
const cancelButtonElement = shadowQuerySelector(
element,
'lightning-button.lightning-record-form-cancel'
);
shadowQuerySelector(element, 'lightning-messages').setError(
'an error'
);
shadowQuerySelector(cancelButtonElement, 'button').click();
return Promise.resolve().then(() => {
const errorMessagesElement = shadowQuerySelector(
element,
'lightning-messages'
);
expect(errorMessagesElement.error.message).toBe('');
expect(errorMessagesElement.textContent).toBe('');
});
});
});
return Promise.resolve().then(() => {
const errorMessagesElement = shadowQuerySelector(
element,
'lightning-messages'
);
expect(errorMessagesElement.error.message).toBe('');
expect(errorMessagesElement.textContent).toBe('');
});
});