fix: rich text link element not validating on create (#3014)
This commit is contained in:
@@ -477,6 +477,27 @@ describe('fields', () => {
|
||||
}
|
||||
|
||||
describe('toolbar', () => {
|
||||
test('should run url validation', async () => {
|
||||
await navigateToRichTextFields();
|
||||
|
||||
// Open link drawer
|
||||
await page.locator('.rich-text__toolbar button:not([disabled]) .link').first().click();
|
||||
|
||||
// find the drawer
|
||||
const editLinkModal = await page.locator('[id^=drawer_1_rich-text-link-]');
|
||||
await expect(editLinkModal).toBeVisible();
|
||||
|
||||
// Fill values and click Confirm
|
||||
await editLinkModal.locator('#field-text').fill('link text');
|
||||
await editLinkModal.locator('label[for="field-linkType-custom"]').click();
|
||||
await editLinkModal.locator('#field-url').fill('');
|
||||
await wait(200);
|
||||
await editLinkModal.locator('button[type="submit"]').click();
|
||||
const errorField = await page.locator('[id^=drawer_1_rich-text-link-] .render-fields > :nth-child(3)');
|
||||
const hasErrorClass = await errorField.evaluate(el => el.classList.contains('error'));
|
||||
expect(hasErrorClass).toBe(true);
|
||||
});
|
||||
|
||||
test('should create new url custom link', async () => {
|
||||
await navigateToRichTextFields();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user