lookbook_visual_tester 0.5.10 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b695b1efdbe2c4ef212efed5fa7a63619ae6942e366cbfb79731cc337164bd4
4
- data.tar.gz: 7ff2aa55244ff5b4279569bbc8d19e97c9921519b3d8003f7c258068e76059dd
3
+ metadata.gz: 3f7d81d326a95c67665b1e7bc5f0e253069f92f4dd9755520da6a915609b8111
4
+ data.tar.gz: 9d5e4fbd12263bffa84e6be352dfcc2dc36a86ea32a7437ec7d310e605cfd87a
5
5
  SHA512:
6
- metadata.gz: 5b8720c41c4f09a5008e913b7c260a6fc0dcd9f6d1373cfd27a4e349efa953a6b014ee4a9268e2d6fa7cb893aa477ace6fd3966173fb56a05fcf318f577c125f
7
- data.tar.gz: 770d6b048097c5de295c9c2b65a5c823d2230e97ff11d60643dc44a623e4deeb68db065680c883b871b8a3d23a0a6704c5151498e55462e034670eac56c69e7e
6
+ metadata.gz: 87f5ee0e350a62685aa7d5c9e7d78dc85c59716c9d0e0ec02b02270a95c21852046b42b8bd9a4b0020b3fe0f9396b4162ad2e00ddc9d6edb9f0707cc88cf51da
7
+ data.tar.gz: 24b7dd96bc5b536b6e51d6987dc87c3cb5818a6d43ba70ff6f16640525cd9963a38aae6ea249add02e60c53496a5477f92a628eee7bc88be7ec4111de118ac68
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Changelog
2
+ ## [0.6.0] - 2026-01-12
3
+
4
+ ### Fixed
5
+ - **Deep Check Error Handling**: Fixed an issue where `deep_check` would fail to capture `ActionView::Template::Error` (and other rendering errors) in components that return a `Hash` payload (common in newer ViewComponent versions). The checker now correctly extracts the component from the hash and properly renders it to detect failures. [PR #123]
6
+
2
7
  ## [0.5.10] - 2026-01-12
3
8
 
4
9
  ### Added
@@ -137,7 +137,6 @@ module LookbookVisualTester
137
137
  # and returns a component that renders the template.
138
138
  if preview_class.respond_to?(:preview_example)
139
139
  result = preview_class.preview_example(example_name)
140
- puts "DEBUG: preview_example('#{example_name}') returned: #{result.inspect} (class: #{result.class})"
141
140
  else
142
141
  # Fallback for older VC or non-standard setups
143
142
  preview_instance = preview_class.new
@@ -148,6 +147,9 @@ module LookbookVisualTester
148
147
  result = preview_instance.public_send(example_name)
149
148
  end
150
149
 
150
+ # Handle Hash return (ViewComponent 3.x+ behavior?)
151
+ result = result[:component] if result.is_a?(Hash) && result.key?(:component)
152
+
151
153
  if result.respond_to?(:render_in)
152
154
  # Mock current_user/pundit if needed on the component itself if possible
153
155
  # But mainly we render it with a view context
@@ -164,16 +166,17 @@ module LookbookVisualTester
164
166
  end
165
167
 
166
168
  output = result.render_in(view_context)
169
+
167
170
  if output.is_a?(String) && output.include?('ActionView::Template::Error')
168
171
  return CheckResult.new(preview_name: preview.name,
169
- example_name:,
172
+ example_name: example_name,
170
173
  status: :failed, error: 'ActionView::Template::Error found in rendered output',
171
174
  backtrace: [])
172
175
  end
173
176
  elsif result.is_a?(String)
174
177
  if result.include?('ActionView::Template::Error')
175
178
  return CheckResult.new(preview_name: preview.name,
176
- example_name:,
179
+ example_name: example_name,
177
180
  status: :failed, error: 'ActionView::Template::Error found in rendered output',
178
181
  backtrace: [])
179
182
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LookbookVisualTester
4
- VERSION = '0.5.10'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookbook_visual_tester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murilo Vasconcelos