Skip to content

Commit

Permalink
test: hasValidChildren 유닛 테스트코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
a-honey committed Jan 14, 2025
1 parent 324d760 commit 7abeee5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/node.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { hasValidChildren } from "./node.utils";

test("return true for valid children case", () => {
const children = [<div key="1">Valid</div>, "Text"];
expect(hasValidChildren(children)).toBe(true);
});

test("return false for invalid or empty children case", () => {
const children = [null, undefined, false];
expect(hasValidChildren(children)).toBe(false);
});

0 comments on commit 7abeee5

Please sign in to comment.