mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-11-19 13:18:52 -06:00
Keep # in in-game names when dropping the discriminator
This commit is contained in:
@@ -1,10 +1,29 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import {
|
||||
inGameNameWithoutDiscriminator,
|
||||
pathnameFromPotentialURL,
|
||||
removeMarkdown,
|
||||
truncateBySentence,
|
||||
} from "./strings";
|
||||
|
||||
describe("inGameNameWithoutDiscriminator()", () => {
|
||||
test.each([
|
||||
{ why: "plain name", inGameName: "Sendou#1234", expected: "Sendou" },
|
||||
{
|
||||
why: "# inside the name",
|
||||
inGameName: "Brook #4#2564",
|
||||
expected: "Brook #4",
|
||||
},
|
||||
{
|
||||
why: "name starting with #",
|
||||
inGameName: "# Sowoul ##1013",
|
||||
expected: "# Sowoul #",
|
||||
},
|
||||
])("keeps the name of $why", ({ inGameName, expected }) => {
|
||||
expect(inGameNameWithoutDiscriminator(inGameName)).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe("pathnameFromPotentialURL()", () => {
|
||||
test("Resolves path name from valid URL", () => {
|
||||
expect(pathnameFromPotentialURL("https://bsky.app/sendouc")).toBe(
|
||||
|
||||
Reference in New Issue
Block a user