From d4ec791b22fc4d765005ecb2fe6e32255a88fa60 Mon Sep 17 00:00:00 2001
From: Naomi Carrigan <commits@nhcarrigan.com>
Date: Sun, 9 Feb 2025 22:25:01 -0800
Subject: [PATCH] feat: update and fix tests

---
 src/config/Games.ts        |  6 ++++++
 src/config/NavItems.ts     |  2 +-
 test/config/Legacy.spec.ts | 43 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 test/config/Legacy.spec.ts

diff --git a/src/config/Games.ts b/src/config/Games.ts
index 366b47c..e4fc4c7 100644
--- a/src/config/Games.ts
+++ b/src/config/Games.ts
@@ -217,4 +217,10 @@ export const Games: Array<{
     name: "Enshrouded",
     url:  "https://store.steampowered.com/app/1203620/Enshrouded/",
   },
+  {
+    alt:  "A person with long dark hair wearing sunglasses and a printed open coat over a gray jumpsuit, standing barefoot against a maroon background",
+    img:  "cyberpunk.jpg",
+    name: "Cyberpunk 2077",
+    url:  "https://store.steampowered.com/app/1091500/Cyberpunk_2077/",
+  },
 ];
diff --git a/src/config/NavItems.ts b/src/config/NavItems.ts
index 120a314..09d580c 100644
--- a/src/config/NavItems.ts
+++ b/src/config/NavItems.ts
@@ -27,7 +27,7 @@ export const NavItems = [
   { href: "https://merch.nhcarrigan.link", text: "Merchandise" },
   { href: "https://docs.nhcarrigan.com", text: "Documentation" },
   { href: "https://forum.nhcarrigan.com", text: "Support" },
-  { href: "/legacy", text: "Characters" },  
+  { href: "/legacy", text: "Characters" },
 ].sort((a, b) => {
   return a.text.localeCompare(b.text);
 });
diff --git a/test/config/Legacy.spec.ts b/test/config/Legacy.spec.ts
new file mode 100644
index 0000000..d07258e
--- /dev/null
+++ b/test/config/Legacy.spec.ts
@@ -0,0 +1,43 @@
+/**
+ * @copyright nhcarrigan
+ * @license Naomi's Public License
+ * @author Naomi Carrigan
+ */
+import { describe, it, expect } from "vitest";
+import { Characters } from "../../src/config/Legacy";
+
+describe("character objects", () => {
+  it("should have unique names", () => {
+    expect.assertions(1);
+    const set = new Set(
+      Object.values(Characters).map((c) => {
+        return c.name;
+      }),
+    );
+    expect(set, "are not unique").toHaveLength(Object.values(Characters).length);
+  });
+
+  it("should not have empty bios", () => {
+    expect.assertions(1);
+    const noBio = Object.values(Characters).filter((c) => {
+      return c.bio.length === 0;
+    });
+    expect(noBio, "found missing bio").toHaveLength(0);
+  });
+
+  it("should not have empty combat profiles", () => {
+    expect.assertions(1);
+    const noCombat = Object.values(Characters).filter((c) => {
+      return c.combat.length === 0;
+    });
+    expect(noCombat, "found missing combat").toHaveLength(0);
+  });
+
+  it("should have alt text", () => {
+    expect.assertions(1);
+    const noText = Object.values(Characters).filter((c) => {
+      return c.alt.length === 0;
+    });
+    expect(noText, "found missing alt").toHaveLength(0);
+  });
+});