1+ import { describe , it , expect } from "vitest" ;
2+ import type { PageLayout } from "../types" ;
3+ import { DefaultLayout } from "./Layout" ;
4+
5+ import { Layout } from "./Layout" ;
6+
7+ describe ( "Layout" , ( ) => {
8+ it ( "should correctly assign all true properties" , ( ) => {
9+ const input : PageLayout = {
10+ copyright : true ,
11+ disclaimer : true ,
12+ revision : true ,
13+ } ;
14+ const layout = new Layout ( input ) ;
15+ expect ( layout . copyright ) . toBe ( true ) ;
16+ expect ( layout . disclaimer ) . toBe ( true ) ;
17+ expect ( layout . revision ) . toBe ( true ) ;
18+ } ) ;
19+
20+ it ( "should correctly assign all false properties" , ( ) => {
21+ const input : PageLayout = {
22+ copyright : false ,
23+ disclaimer : false ,
24+ revision : false ,
25+ } ;
26+ const layout = new Layout ( input ) ;
27+ expect ( layout . copyright ) . toBe ( false ) ;
28+ expect ( layout . disclaimer ) . toBe ( false ) ;
29+ expect ( layout . revision ) . toBe ( false ) ;
30+ } ) ;
31+
32+ it ( "should correctly assign mixed property values" , ( ) => {
33+ const input : PageLayout = {
34+ copyright : true ,
35+ disclaimer : false ,
36+ revision : true ,
37+ } ;
38+ const layout = new Layout ( input ) ;
39+ expect ( layout . copyright ) . toBe ( true ) ;
40+ expect ( layout . disclaimer ) . toBe ( false ) ;
41+ expect ( layout . revision ) . toBe ( true ) ;
42+ } ) ;
43+
44+ it ( "DefaultLayout should have all properties true" , ( ) => {
45+ expect ( DefaultLayout . copyright ) . toBe ( true ) ;
46+ expect ( DefaultLayout . disclaimer ) . toBe ( true ) ;
47+ expect ( DefaultLayout . revision ) . toBe ( true ) ;
48+ } ) ;
49+ } ) ;
0 commit comments