-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjuice_options_test.go
52 lines (45 loc) · 1.3 KB
/
juice_options_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package mjml
import (
"reflect"
"testing"
)
func TestJuiceOptions(t *testing.T) {
options := NewJuiceOptions().
ApplyAttributesTableElements(true).
ApplyHeightAttributes(true).
ApplyStyleTags(true).
ApplyWidthAttributes(true).
ExtraCss("somestring").
InsertPreservedExtraCss(true).
InlinePseudoElements(true).
PreserveFontFaces(true).
PreserveImportant(true).
PreserveMediaQueries(true).
PreserveKeyFrames(true).
PreservePseudos(true).
RemoveStyleTags(true).
XmlMode(true)
expected := map[string]interface{}{
"applyAttributesTableElements": true,
"applyHeightAttributes": true,
"applyStyleTags": true,
"applyWidthAttributes": true,
"extraCss": "somestring",
"insertPreservedExtraCss": true,
"inlinePseudoElements": true,
"preserveFontFaces": true,
"preserveImportant": true,
"preserveMediaQueries": true,
"preserveKeyFrames": true,
"preservePseudos": true,
"removeStyleTags": true,
"xmlMode": true,
}
juiceOptions, ok := options.(*juiceOptions)
if !ok {
t.Fatal("Options is not a *juiceOptions")
}
if !reflect.DeepEqual(juiceOptions.data, expected) {
t.Error("JuiceOptions does not match expected data")
}
}