diff options
author | Markus Wüstenberg | 2020-12-22 11:46:49 +0100 |
---|---|---|
committer | GitHub | 2020-12-22 11:46:49 +0100 |
commit | d41c4e5a85362dec7844a9093b43720eb0e70e72 (patch) | |
tree | 8b9fc056e2721b7403e40852de7abb998dcad993 /html/attributes_test.go | |
parent | b4918d5a63434e162e5547cf0e8461fcd1931765 (diff) | |
download | gomponents-d41c4e5a85362dec7844a9093b43720eb0e70e72.tar.lz gomponents-d41c4e5a85362dec7844a9093b43720eb0e70e72.tar.zst gomponents-d41c4e5a85362dec7844a9093b43720eb0e70e72.zip |
Add data- attribute helper (#61)
Fixes #49.
Diffstat (limited to 'html/attributes_test.go')
-rw-r--r-- | html/attributes_test.go | 7 |
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) + }) +} |