Merge pull request #1428 from appwrite/fix-check-chars-project-id

Change regex for custom project id
This commit is contained in:
Arman authored and GitHub committed 2024-10-18 15:09:03 +02:00
commit 67e3e7651d
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@
let element: HTMLInputElement;
let icon = 'info';
const pattern = String.raw`^[a-zA-Z0-9][a-zA-Z0-9._\-]*$`;
const pattern = String.raw`^[a-zA-Z0-9][a-zA-Z0-9\-]*$`;
onMount(() => {
if (element && autofocus) {
@@ -55,6 +55,6 @@
class="u-cross-center u-line-height-1 u-color-text-gray"
aria-hidden="true" />
<span class="text u-line-height-1-5">
Allowed characters: alphanumeric, non-leading hyphen, underscore, period
Allowed characters: alphanumeric and non-leading hyphen
</span>
</div>
+2 -2
View File
@@ -3,9 +3,9 @@ import { render } from '@testing-library/svelte';
import userEvent from '@testing-library/user-event';
import { InputId } from '../../../src/lib/elements/forms';
const validStrings = ['valid_string', 'valid-string', 'valid.string', 'validstring123', 'valid_'];
const validStrings = ['valid-string', 'validstring', 'validstring123', 'valid-'];
const invalidStrings = ['-invalid', '.invalid', '_invalid'];
const invalidStrings = ['-invalid', '.invalid', 'in_valid', 'in.va.lid'];
test('shows id input', () => {
const { getByPlaceholderText } = render(InputId);