File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments