Fix some missing JS class collector cases

Fixes #7216
This commit is contained in:
Bjørn Erik Pedersen
2020-04-27 17:49:51 +02:00
parent fe60b7d9e4
commit c03ea2b660
2 changed files with 18 additions and 17 deletions

View File

@@ -70,6 +70,15 @@ func TestClassCollector(t *testing.T) {
{"Alpine bind 4", `<div x-bind:class="{ 'text-gray-800': !checked,
'text-white': checked }"></div>`, f("div", "text-gray-800 text-white", "")},
{"Alpine bind 5", `<a x-bind:class="{
'text-a': a && b,
'text-b': !a && b || c,
'pl-3': a === 1,
pl-2: b == 3,
'text-gray-600': (a > 1)
}" class="block w-36 cursor-pointer pr-3 no-underline capitalize"></a>`, f("a", "block capitalize cursor-pointer no-underline pl-2 pl-3 pr-3 text-a text-b text-gray-600 w-36", "")},
{"Vue bind", `<div v-bind:class="{ active: isActive }"></div>`, f("div", "active", "")},
} {
c.Run(test.name, func(c *qt.C) {