mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:21:27 +00:00
fix: correct error message for clan tag length (BUG-07) (#3946)
## Description: The code was checking `clanTag.length > MAX_CLAN_TAG_LENGTH` but returning `"tag_too_short"`. This fix corrects the error message to something more appropriate or ensures the logic matches the message. **Fix:** Corrected the error message key from `"tag_too_short"` to `"tag_too_long"` when the length exceeds the maximum. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: barfires Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
This commit is contained in:
@@ -63,7 +63,7 @@ describe("username.ts functions", () => {
|
||||
test("rejects too long clan tag", () => {
|
||||
const res = validateClanTag("A".repeat(MAX_CLAN_TAG_LENGTH + 1));
|
||||
expect(res.isValid).toBe(false);
|
||||
expect(res.error).toBe("username.tag_too_short");
|
||||
expect(res.error).toBe("username.tag_too_long");
|
||||
});
|
||||
|
||||
test("accepts valid clan tag", () => {
|
||||
|
||||
Reference in New Issue
Block a user