fix(contextMenu): Remove regular expression validation (#10994)

* fix: remove regex validation

* test: remove incorrect test

This is fine to create.

* fix: guard against whitespace
This commit is contained in:
Jiralite
2025-07-16 16:47:29 +01:00
committed by GitHub
parent 9ff04820b3
commit 1dfc511e4f
2 changed files with 3 additions and 3 deletions

View File

@@ -12,8 +12,6 @@ describe('Context Menu Commands', () => {
});
test('GIVEN invalid name THEN throw error', () => {
expect(() => getBuilder().setName('$$$').toJSON()).toThrowError();
expect(() => getBuilder().setName(' ').toJSON()).toThrowError();
});

View File

@@ -6,7 +6,9 @@ const namePredicate = z
.string()
.min(1)
.max(32)
.regex(/^(?:(?: *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}\p{Extended_Pictographic}\p{Emoji_Component}]) *)+$/u);
.refine((val) => val.trim().length > 0, {
error: 'Must not consist of only whitespace.',
});
const contextsPredicate = z.array(z.enum(InteractionContextType));
const integrationTypesPredicate = z.array(z.enum(ApplicationIntegrationType));