mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
build: decouple package deps and introduce yarn workspaces (#7415)
* feat: decouple package deps and introduce yarn workspaces * update root directory * fix * fix scripts * fix lint * update path in scripts * remove yarn.lock files from packages * ignore workspace * dummy * dummy * remove comment check * revert workflow changes * ignore ws when installing gh actions * remove log * update path * fix * fix typo
This commit is contained in:
parent
b7d7ccc929
commit
d6cd8b78f1
567 changed files with 5066 additions and 8648 deletions
39
packages/excalidraw/tests/clients.test.ts
Normal file
39
packages/excalidraw/tests/clients.test.ts
Normal file
|
@ -0,0 +1,39 @@
|
|||
import { getNameInitial } from "../clients";
|
||||
|
||||
describe("getClientInitials", () => {
|
||||
it("returns substring if one name provided", () => {
|
||||
expect(getNameInitial("Alan")).toBe("A");
|
||||
});
|
||||
|
||||
it("returns initials", () => {
|
||||
expect(getNameInitial("John Doe")).toBe("J");
|
||||
});
|
||||
|
||||
it("returns correct initials if many names provided", () => {
|
||||
expect(getNameInitial("John Alan Doe")).toBe("J");
|
||||
});
|
||||
|
||||
it("returns single initial if 1 letter provided", () => {
|
||||
expect(getNameInitial("z")).toBe("Z");
|
||||
});
|
||||
|
||||
it("trims trailing whitespace", () => {
|
||||
expect(getNameInitial(" q ")).toBe("Q");
|
||||
});
|
||||
|
||||
it('returns "?" if falsey value provided', () => {
|
||||
expect(getNameInitial("")).toBe("?");
|
||||
expect(getNameInitial(undefined)).toBe("?");
|
||||
expect(getNameInitial(null)).toBe("?");
|
||||
});
|
||||
|
||||
it('returns "?" when value is blank', () => {
|
||||
expect(getNameInitial(" ")).toBe("?");
|
||||
});
|
||||
|
||||
it("works with multibyte strings", () => {
|
||||
expect(getNameInitial("😀")).toBe("😀");
|
||||
// but doesn't work with emoji ZWJ sequences
|
||||
expect(getNameInitial("👨👩👦")).toBe("👨");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue