+
{children}
);
@@ -23,9 +31,3 @@ export function InfoSectionContent({
}) {
return
{children}
;
}
-
-export function Divider() {
- return (
-
- );
-}
diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx
index 9edd2802..6a65a30b 100644
--- a/src/components/ui/checkbox.tsx
+++ b/src/components/ui/checkbox.tsx
@@ -13,7 +13,7 @@ const Checkbox = React.forwardRef<
(actual: T, expected: T, message: string): void {
+ const actualStr = JSON.stringify(actual);
+ const expectedStr = JSON.stringify(expected);
+ if (actualStr !== expectedStr) {
+ throw new Error(`${message}\nExpected: ${expectedStr}\nActual: ${actualStr}`);
+ }
+}
+
+/**
+ * Compares two primitive values for equality
+ * @param actual The actual value to test
+ * @param expected The expected value to compare against
+ * @param message The message to display if assertion fails
+ * @throws Error if values are not equal
+ */
+export function assertEquals(actual: T, expected: T, message: string): void {
+ if (actual !== expected) {
+ throw new Error(`${message}\nExpected: ${expected}\nActual: ${actual}`);
+ }
+}
+
+/**
+ * Tests if a function throws an expected error
+ * @param fn The function to test
+ * @param expectedError The expected error message or part of it
+ * @param message The message to display if assertion fails
+ * @throws Error if function doesn't throw or throws unexpected error
+ */
+export function assertThrows(
+ fn: () => void,
+ expectedError: string,
+ message: string
+): void {
+ try {
+ fn();
+ throw new Error(`${message}: Expected to throw "${expectedError}"`);
+ } catch (error) {
+ if (!(error instanceof Error)) {
+ throw new Error(`${message}\nUnexpected error type: ${typeof error}`);
+ }
+
+ if (!error.message.includes(expectedError)) {
+ throw new Error(
+ `${message}\nExpected error: ${expectedError}\nActual error: ${error.message}`
+ );
+ }
+ }
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index d92e7275..94729399 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -15,6 +15,7 @@
"baseUrl": "src",
"paths": {
"@server/*": ["../server/*"],
+ "@test/*": ["../test/*"],
"@app/*": ["*"],
"@/*": ["./*"]
},