From 7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7 Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Tue, 8 Jun 2021 16:52:57 +0200 Subject: Add LinkStylesheet and LinkPreload components (#79) These are often used in the `
` part of the HTML.--- components/elements_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'components/elements_test.go') diff --git a/components/elements_test.go b/components/elements_test.go index 334ed2c..7dc4eec 100644 --- a/components/elements_test.go +++ b/components/elements_test.go @@ -14,3 +14,17 @@ func TestInputHidden(t *testing.T) { assert.Equal(t, ``, n) }) } + +func TestLinkStylesheet(t *testing.T) { + t.Run("returns a link element with rel stylesheet and the given href", func(t *testing.T) { + n := c.LinkStylesheet("style.css", g.Attr("media", "print")) + assert.Equal(t, ``, n) + }) +} + +func TestLinkPreload(t *testing.T) { + t.Run("returns a link element with rel preload and the given href and as", func(t *testing.T) { + n := c.LinkPreload("party.woff2", "font", g.Attr("type", "font/woff2")) + assert.Equal(t, ``, n) + }) +} -- cgit 1.4.1