summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/stickers/__tests__
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-03-27 00:55:15 +0100
committerMaze Winther <mazewinther@gmail.com>2026-03-29 15:56:48 +0200
commit4d127a038bf768eded68aae3cfa5c1b12241bdac (patch)
tree16bbb801caf6770546cff4fdb37b6408ec9ead98 /apps/web/src/lib/stickers/__tests__
parent82817cb50cb0487350573d6129130aec705f924b (diff)
downloadopencut-4d127a038bf768eded68aae3cfa5c1b12241bdac.tar.gz
chore: normalize line endings
Diffstat (limited to 'apps/web/src/lib/stickers/__tests__')
-rw-r--r--apps/web/src/lib/stickers/__tests__/sticker-id.test.ts68
1 files changed, 34 insertions, 34 deletions
diff --git a/apps/web/src/lib/stickers/__tests__/sticker-id.test.ts b/apps/web/src/lib/stickers/__tests__/sticker-id.test.ts
index 3236e213..26458a7c 100644
--- a/apps/web/src/lib/stickers/__tests__/sticker-id.test.ts
+++ b/apps/web/src/lib/stickers/__tests__/sticker-id.test.ts
@@ -1,34 +1,34 @@
-import { describe, expect, test } from "bun:test";
-import { buildStickerId, parseStickerId } from "../sticker-id";
-
-describe("sticker-id strict mode", () => {
- test("parses provider-prefixed IDs", () => {
- expect(parseStickerId({ stickerId: "flags:US" })).toEqual({
- providerId: "flags",
- providerValue: "US",
- });
- expect(parseStickerId({ stickerId: "shapes:circle" })).toEqual({
- providerId: "shapes",
- providerValue: "circle",
- });
- });
-
- test("throws for IDs without provider prefix", () => {
- expect(() => parseStickerId({ stickerId: "home" })).toThrow();
- });
-
- test("throws for malformed IDs", () => {
- expect(() => parseStickerId({ stickerId: "" })).toThrow();
- expect(() => parseStickerId({ stickerId: "flags:" })).toThrow();
- expect(() => parseStickerId({ stickerId: ":mdi:home" })).toThrow();
- });
-
- test("builds sticker IDs unchanged", () => {
- expect(
- buildStickerId({
- providerId: "flags",
- providerValue: "US",
- }),
- ).toBe("flags:US");
- });
-});
+import { describe, expect, test } from "bun:test";
+import { buildStickerId, parseStickerId } from "../sticker-id";
+
+describe("sticker-id strict mode", () => {
+ test("parses provider-prefixed IDs", () => {
+ expect(parseStickerId({ stickerId: "flags:US" })).toEqual({
+ providerId: "flags",
+ providerValue: "US",
+ });
+ expect(parseStickerId({ stickerId: "shapes:circle" })).toEqual({
+ providerId: "shapes",
+ providerValue: "circle",
+ });
+ });
+
+ test("throws for IDs without provider prefix", () => {
+ expect(() => parseStickerId({ stickerId: "home" })).toThrow();
+ });
+
+ test("throws for malformed IDs", () => {
+ expect(() => parseStickerId({ stickerId: "" })).toThrow();
+ expect(() => parseStickerId({ stickerId: "flags:" })).toThrow();
+ expect(() => parseStickerId({ stickerId: ":mdi:home" })).toThrow();
+ });
+
+ test("builds sticker IDs unchanged", () => {
+ expect(
+ buildStickerId({
+ providerId: "flags",
+ providerValue: "US",
+ }),
+ ).toBe("flags:US");
+ });
+});