-
Notifications
You must be signed in to change notification settings - Fork 0
/
metanode_test.go
39 lines (32 loc) · 1.19 KB
/
metanode_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
package smetana
import "testing"
func TestRenderMeta(t *testing.T) {
node := Meta("foo", "bar")
result := RenderHtmlOpts(node, true, nil)
assertEqual(t, "<meta content=\"bar\" name=\"foo\">", result)
}
func TestRenderKeywords(t *testing.T) {
node := Keywords("some,keywords")
result := RenderHtmlOpts(node, true, nil)
assertEqual(t, "<meta content=\"some,keywords\" name=\"keywords\">", result)
}
func TestRenderDescription(t *testing.T) {
node := Description("a description")
result := RenderHtmlOpts(node, true, nil)
assertEqual(t, "<meta content=\"a description\" name=\"description\">", result)
}
func TestRenderAuthor(t *testing.T) {
node := Author("A. Developer")
result := RenderHtmlOpts(node, true, nil)
assertEqual(t, "<meta content=\"A. Developer\" name=\"author\">", result)
}
func TestRenderViewport(t *testing.T) {
node := Viewport("some-value")
result := RenderHtmlOpts(node, true, nil)
assertEqual(t, "<meta content=\"some-value\" name=\"viewport\">", result)
}
func TestRenderViewportDefault(t *testing.T) {
node := Viewport("")
result := RenderHtmlOpts(node, true, nil)
assertEqual(t, "<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\">", result)
}