package hx_trigger

import (
	"testing"
)

func TestHxTrigger(t *testing.T) {
	swap := NewHxTrigger()
	if swap == nil {
		t.Fatalf("swap==nil")
	}
	if tag := swap.Get(); tag != "" {
		t.Fatalf("tag not empty")
	}
	swap.Set("every 1s")
	if tag := swap.Get(); tag != "every 1s" {
		t.Fatalf("tag bad")
	}
	if str := swap.String(); str != `hx-trigger="every 1s"` {
		t.Fatalf("str is bad")
	}
}
