@@ -13,9 +13,9 @@ class Tailwindcss::PurgerTest < ActiveSupport::TestCase
13
13
14
14
test "basic purge" do
15
15
purged = purged_tailwind_from_fixtures
16
-
16
+
17
17
assert purged !~ /.mt-6 \{ /
18
-
18
+
19
19
assert purged =~ /.mt-5 \{ /
20
20
assert purged =~ /.sm\\ :px-6 \{ /
21
21
assert purged =~ /.translate-x-1\\ \/ 2 \{ /
@@ -29,9 +29,18 @@ class Tailwindcss::PurgerTest < ActiveSupport::TestCase
29
29
assert purged =~ /.focus-within\\ \: outline-black\: focus-within \{ /
30
30
end
31
31
32
+ test "purge should remove unused group-hover classes" do
33
+ purged = purged_tailwind_from_fixtures
34
+
35
+ assert purged !~ /.group\: hover .group-hover\\ \: bg-blue-900 \{ /
36
+
37
+ assert purged =~ /.group\: hover .group-hover\\ \: bg-gray-900 \{ /
38
+ assert purged =~ /.group\: hover .group-hover\\ \: bg-red-500 \{ /
39
+ end
40
+
32
41
test "purge shouldn't remove placeholder selectors" do
33
42
purged = Tailwindcss ::Purger . purge \
34
- Pathname . new ( __FILE__ ) . join ( "../../app/assets/stylesheets/tailwind.css" ) . read ,
43
+ Pathname . new ( __FILE__ ) . join ( "../../app/assets/stylesheets/tailwind.css" ) . read ,
35
44
keeping_class_names_from_files : Pathname ( __dir__ ) . join ( "fixtures/placeholders.html.erb" )
36
45
37
46
assert purged =~ /.placeholder-transparent\: \: -moz-placeholder \{ /
@@ -42,7 +51,7 @@ class Tailwindcss::PurgerTest < ActiveSupport::TestCase
42
51
private
43
52
def purged_tailwind_from_fixtures
44
53
Tailwindcss ::Purger . purge \
45
- Pathname . new ( __FILE__ ) . join ( "../../app/assets/stylesheets/tailwind.css" ) . read ,
54
+ Pathname . new ( __FILE__ ) . join ( "../../app/assets/stylesheets/tailwind.css" ) . read ,
46
55
keeping_class_names_from_files : Pathname ( __dir__ ) . glob ( "fixtures/*.html.erb" )
47
56
end
48
57
end
0 commit comments