about summary refs log tree commit diff stats
path: root/html/attributes_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'html/attributes_test.go')
-rw-r--r--html/attributes_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 23445db..b0f76c1 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -83,3 +83,10 @@ func TestAria(t *testing.T) {
 		assert.Equal(t, ` aria-selected="true"`, n)
 	})
 }
+
+func TestDataAttr(t *testing.T) {
+	t.Run("returns an attribute which name is prefixed with data-", func(t *testing.T) {
+		n := DataAttr("id", "partyhat")
+		assert.Equal(t, ` data-id="partyhat"`, n)
+	})
+}