Skip to content

Commit 8981cb0

Browse files
committed
0.1.1
Tests: - Custom CSS tests
1 parent a2c639e commit 8981cb0

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Describe 'Render-CustomCSS' {
2+
BeforeAll {
3+
. (Resolve-Path "$PSScriptRoot\..\..\..\src\templates\elements\custom-css.ps1").Path
4+
}
5+
6+
It 'Should render custom css for a group page. 0 directory depth.' {
7+
$template = @'
8+
<!--something-->
9+
<!--custom.css-->
10+
<!--something.else-->
11+
'@
12+
$expected = @'
13+
<!--something-->
14+
<link rel="stylesheet" type="text/css" href="css/group_page_custom.css" />
15+
<!--something.else-->
16+
'@
17+
$directoryDepth = 0
18+
$pageType = 'group'
19+
20+
$result = Render-CustomCss -template $template -directoryDepth $directoryDepth -pageType $pageType
21+
$result | Should -Be $expected
22+
}
23+
24+
It 'Should render custom css for a group page. Non 0 directory depth.' {
25+
$template = @'
26+
<!--something-->
27+
<!--custom.css-->
28+
<!--something.else-->
29+
'@
30+
$expected = @'
31+
<!--something-->
32+
<link rel="stylesheet" type="text/css" href="../../../css/group_page_custom.css" />
33+
<!--something.else-->
34+
'@
35+
$directoryDepth = 3
36+
$pageType = 'group'
37+
38+
$result = Render-CustomCss -template $template -directoryDepth $directoryDepth -pageType $pageType
39+
$result | Should -Be $expected
40+
}
41+
42+
It 'Should render custom css for a source page. Non 0 directory depth.' {
43+
$template = @'
44+
<!--something-->
45+
<!--custom.css-->
46+
<!--something.else-->
47+
'@
48+
$expected = @'
49+
<!--something-->
50+
<link rel="stylesheet" type="text/css" href="../../../css/source_page_custom.css" />
51+
<!--something.else-->
52+
'@
53+
$directoryDepth = 3
54+
$pageType = 'source'
55+
56+
$result = Render-CustomCss -template $template -directoryDepth $directoryDepth -pageType $pageType
57+
$result | Should -Be $expected
58+
}
59+
}

0 commit comments

Comments
 (0)