Skip to content

Commit fd79a7f

Browse files
author
Richard Feldman
committed
Add fixture test for Dreamwriter-based stylesheet.
1 parent f23115a commit fd79a7f

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

app/src/DreamwriterStyle.elm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ type CssIds = Page
99
pageBackground = rgb 100 90 128
1010
pageDefaultText = rgb 40 35 76
1111

12-
exports : Style CssClasses CssIds
13-
exports =
12+
13+
dreamwriter : Style CssClasses CssIds
14+
dreamwriter =
1415
stylesheet
1516
|%|... [ html, body ]
1617
|-| width 100 pct

test/Fixtures.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ divWidthHeight =
1818
|-| height 50 px
1919

2020

21-
exports : Style CssClasses CssIds
22-
exports =
21+
dreamwriter : Style CssClasses CssIds
22+
dreamwriter =
2323
stylesheet
2424
|%|... [ html, body ]
2525
|-| width 100 pct

test/Tests.elm

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ all : Test
1616
all =
1717
suite "elm-stylesheets"
1818
[ divWidthHeight
19+
, dreamwriter
1920
]
2021

2122

@@ -32,3 +33,49 @@ divWidthHeight =
3233
[ test "pretty prints the expected output" <|
3334
assertEqual output (prettyPrint input)
3435
]
36+
37+
38+
dreamwriter : Test
39+
dreamwriter =
40+
let
41+
input =
42+
Fixtures.dreamwriter
43+
44+
output = String.trim """
45+
html, body {
46+
width: 100%;
47+
height: 100%;
48+
box-sizing: border-box;
49+
padding: 0px;
50+
margin: 0px;
51+
}
52+
53+
body {
54+
min-width: 1280px;
55+
overflow-x: auto;
56+
}
57+
58+
body > div {
59+
width: 100%;
60+
height: 100%;
61+
}
62+
63+
.Hidden {
64+
display: none !important;
65+
}
66+
67+
#Page {
68+
width: 100%;
69+
height: 100%;
70+
box-sizing: border-box;
71+
margin: 0px;
72+
padding: 8px;
73+
background-color: rgb(100, 90, 128);
74+
color: rgb(40, 35, 76);
75+
}
76+
"""
77+
in
78+
suite "Sample stylesheet from Dreamwriter"
79+
[ test "pretty prints the expected output" <|
80+
assertEqual output (prettyPrint input)
81+
]

0 commit comments

Comments
 (0)