fix(editor): Fix flaky mapping tests (#10453)
This commit is contained in:
@@ -10,7 +10,7 @@ describe('NoUrl', () => {
|
||||
const entity = new Entity();
|
||||
|
||||
describe('URLs', () => {
|
||||
const URLS = ['http://google.com', 'www.domain.tld'];
|
||||
const URLS = ['http://google.com', 'www.domain.tld', 'n8n.io'];
|
||||
|
||||
for (const str of URLS) {
|
||||
test(`should block ${str}`, async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ValidationOptions, ValidatorConstraintInterface } from 'class-validator';
|
||||
import { registerDecorator, ValidatorConstraint } from 'class-validator';
|
||||
|
||||
const URL_REGEX = /^(https?:\/\/|www\.)/i;
|
||||
const URL_REGEX = /^(https?:\/\/|www\.)|(\.[\p{L}\d-]+)/iu;
|
||||
|
||||
@ValidatorConstraint({ name: 'NoUrl', async: false })
|
||||
class NoUrlConstraint implements ValidatorConstraintInterface {
|
||||
|
||||
Reference in New Issue
Block a user