about summary refs log tree commit diff stats
path: root/el/media_test.go
blob: 0c078ddc1f0d1695778305a67aab6f993d278c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package el_test

import (
	"testing"

	g "github.com/maragudk/gomponents"
	"github.com/maragudk/gomponents/assert"
	"github.com/maragudk/gomponents/el"
)

func TestImg(t *testing.T) {
	t.Run("returns an img element with href and alt attributes", func(t *testing.T) {
		assert.Equal(t, `<img src="hat.png" alt="hat" id="image" />`, el.Img("hat.png", "hat", g.Attr("id", "image")))
	})
}