Repository navigation
test: add view render coverage for View.Make, View.First and Template.Render (framework#1594) - #163
Merged
Conversation
….Render (framework#1594) Pin the framework replace to c67cea85 so the new render API is available, register a define-only nav fixture in the viewtest package source, and cover request-free rendering, data/With/Name, app-over-package precedence, First fall-through, invalid data and shared-data merging.
hwbrzzl
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
View.Make,View.FirstandTemplate.Rendernow have feature coverage that renders views with no HTTP request in scope: request-bound values such ascsrf_tokencome out empty, while nested templates and path-named files still resolve.LoadViewsFromrenders next to app views, andresources/viewsstill wins over an identical define name in a package.View.Firstis pinned to its full contract: missing and define-only files are skipped instead of returned, no renderable candidate surfaces aserrors.ViewNoneExist, and unusable data surfaces aserrors.ViewInvalidDatafromRender, never fromMake.Why
goravel/framework#1594adds a render path that returns the rendered string instead of writing to a response, so views can be produced from console commands, queued jobs and mail without a request in scope. The example app only covered views behindhttp.Context, which left the string API, its data handling and its fall-through behaviour untested.tests/feature/view_render_test.gocloses that gap and also covers the shared-data merge, where template data wins overShareand rendering does not write back into the shared map.The framework
replaceis pinned tov1.18.1-0.20261027090652-c67cea858086(c67cea85), the commit that introducesMake,FirstandRender, so the suite compiles against the feature while it is still unreleased;go mod tidymoved a few transitive versions with it. The define-onlynav.tmplfixture lives in the already-registeredpackages/viewtest/views/partialsdirectory, which givesFirsta file that exists but cannot render under its own path without shipping a test-only partial inresources/views. The existing HTTPViewTestSuitestill passes against the new pin.