# frozen_string_literal: true
require_relative "../test_helper"
module Lexer
class AttributesTest < Minitest::Spec
include SnapshotUtils
test "attribute value double quotes" do
assert_lexed_snapshot(%())
end
test "attribute value single quotes" do
assert_lexed_snapshot(%(
))
end
test "attribute value empty double quotes with whitespace" do
assert_lexed_snapshot(%(
))
end
test "attribute value empty double quotes without whitespace" do
assert_lexed_snapshot(%(
))
end
test "attribute value empty single quotes with whitespace" do
assert_lexed_snapshot("
")
end
test "attribute value empty single quotes without whitespace" do
assert_lexed_snapshot("
")
end
test "attribute value single quotes with slash gt" do
assert_lexed_snapshot("
")
end
test "attribute value double quotes with slash gt" do
# `>` is not valid as an attribute value, it should be < which is why we parse it as TOKEN_HTML_TAG_END
assert_lexed_snapshot(%(
))
end
test "attribute value single quotes with > value" do
# `>` is not valid as an attribute value, it should be < which is why we parse it as TOKEN_HTML_TAG_END
assert_lexed_snapshot(%(
))
end
test "attribute value double quotes with slash" do
assert_lexed_snapshot(%(
))
end
test "Alpine.js @click attribute" do
assert_lexed_snapshot(%())
end
test "Alpine.js @submit attribute" do
assert_lexed_snapshot(%(