diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-08-08 01:01:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-07 17:01:01 -0500 |
commit | 93c4719a2140070b33f69dd0f12b4de2619a25a6 (patch) | |
tree | 0396daa890b1023097385748f2194b16d1fa6fa4 /__tests__ | |
parent | f708e884107c75559759b22901c87e57d5b979da (diff) | |
download | voidsky-93c4719a2140070b33f69dd0f12b4de2619a25a6.tar.zst |
Check handle as you type (#8601)
* check handle as you type * metrics * add metric types * fix overflow * only check reserved handles for bsky.social, fix test * change validation check name * tweak input * move ghosttext component to textfield * tweak styles to try and match latest * add suggestions * improvements, metrics * share logic between typeahead and next button * Apply suggestions from code review Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * update checks, disable button if unavailable * convert to lowercase * fix bug with checkHandleAvailability * add gate * move files around to make clearer * fix bad import * Fix flashing next button * Enable for TF --------- Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> Co-authored-by: Hailey <me@haileyok.com> Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to '__tests__')
-rw-r--r-- | __tests__/lib/strings/handles.test.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/__tests__/lib/strings/handles.test.ts b/__tests__/lib/strings/handles.test.ts index 4456fae94..f3b289afd 100644 --- a/__tests__/lib/strings/handles.test.ts +++ b/__tests__/lib/strings/handles.test.ts @@ -1,4 +1,4 @@ -import {IsValidHandle, validateServiceHandle} from '#/lib/strings/handles' +import {type IsValidHandle, validateServiceHandle} from '#/lib/strings/handles' describe('handle validation', () => { const valid = [ @@ -18,17 +18,17 @@ describe('handle validation', () => { }) const invalid = [ - ['al', 'bsky.social', 'frontLength'], + ['al', 'bsky.social', 'frontLengthNotTooShort'], ['-alice', 'bsky.social', 'hyphenStartOrEnd'], ['alice-', 'bsky.social', 'hyphenStartOrEnd'], ['%%%', 'bsky.social', 'handleChars'], - ['1234567890123456789', 'bsky.social', 'frontLength'], + ['1234567890123456789', 'bsky.social', 'frontLengthNotTooLong'], [ '1234567890123456789', 'my-custom-pds-with-long-name.social', - 'frontLength', + 'frontLengthNotTooLong', ], - ['al', 'my-custom-pds-with-long-name.social', 'frontLength'], + ['al', 'my-custom-pds-with-long-name.social', 'frontLengthNotTooShort'], ['a'.repeat(300), 'toolong.com', 'totalLength'], ] satisfies [string, string, keyof IsValidHandle][] it.each(invalid)( |