forked from finos/vuu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21f2303
commit 7cd36c6
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { LayoutJSON, isLayoutJSON } from "../src"; | ||
|
||
const validLayout: LayoutJSON = { | ||
type: "Stack", | ||
}; | ||
|
||
const invalidLayout: unknown = { | ||
name: "invalid-layout-test", | ||
}; | ||
|
||
describe("isLayoutJSON", () => { | ||
it("returns true when layout is valid", () => { | ||
const result = isLayoutJSON(validLayout); | ||
|
||
expect(result).toBe(true); | ||
}); | ||
|
||
it("returns false when layout is not valid", () => { | ||
const result = isLayoutJSON(invalidLayout as LayoutJSON); | ||
|
||
expect(result).toBe(false); | ||
}); | ||
|
||
it("returns false when layout is undefined", () => { | ||
const result = isLayoutJSON(undefined as unknown as LayoutJSON); | ||
|
||
expect(result).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters