fix(editor): Fix flaky mapping tests (#10453)

This commit is contained in:
Elias Meire
2024-08-16 15:30:20 +02:00
committed by GitHub
parent b857c2cda0
commit fc6d4138d5
6 changed files with 23 additions and 11 deletions

View File

@@ -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 () => {

View File

@@ -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 {