Skip to content

Commit

Permalink
Merge pull request #5558 from solidusio/elia/admin/tw-spec
Browse files Browse the repository at this point in the history
[admin] Build the admin CSS before running the specs
  • Loading branch information
elia authored Dec 19, 2023
2 parents b3878ef + c566ac1 commit ebd123a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
flex gap-3 items-center
py-1 px-3 rounded
hover:text-red-500 hover:bg-gray-50
<%= "text-red-500 bg-gray-50" if active? %>
<%= "text-red-600 bg-gray-50" if active? %>
<%= @item.top_level ? "font-semibold text-sm text-black" : "font-normal text-sm text-gray-600" %>
"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
flex gap-1 flex-col
">
<%= tag.span @hint if @hint.present? %>
<%= tag.span safe_join(@error, tag.br), class: "text-red-400" if @error.present? %>
<%= tag.span safe_join(@error, tag.br), class: "text-red-600" if @error.present? %>
</div>
<% end %>
</label>
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def initialize(tag: :input, size: :m, error: nil, **attributes)
hover:border-gray-500
focus:ring focus:ring-gray-300 focus:ring-0.5 focus:bg-white focus:ring-offset-0 [&:focus-visible]:outline-none
disabled:bg-gray-50 disabled:text-gray-500 disabled:placeholder:text-gray-300 disabled:cursor-not-allowed
invalid:border-red-400 invalid:hover:border-red-400 invalid:text-red-400
aria-invalid:border-red-400 aria-invalid:hover:border-red-400 aria-invalid:text-red-400
invalid:border-red-600 invalid:hover:border-red-600 invalid:text-red-600
aria-invalid:border-red-600 aria-invalid:hover:border-red-600 aria-invalid:text-red-600
],
SIZES[size],
specialized_classes,
Expand Down
6 changes: 6 additions & 0 deletions admin/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
mount Spree::Core::Engine, at: '/'
end

unless SolidusAdmin::Engine.root.join('app/assets/builds/solidus_admin/tailwind.css').exist?
Dir.chdir(SolidusAdmin::Engine.root) do
system 'bundle exec rake tailwindcss:build' or abort 'Failed to build Tailwind CSS'
end
end

# RAILS
require "rspec/rails"
ENV["RAILS_ENV"] ||= 'test'
Expand Down

0 comments on commit ebd123a

Please sign in to comment.