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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/lookbook_visual_tester/preview_checker.rb +6 -3
- data/lib/lookbook_visual_tester/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f7d81d326a95c67665b1e7bc5f0e253069f92f4dd9755520da6a915609b8111
|
|
4
|
+
data.tar.gz: 9d5e4fbd12263bffa84e6be352dfcc2dc36a86ea32a7437ec7d310e605cfd87a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|