Skip to content

Commit 5320231

Browse files
committed
images: Add some test cases for aligny on images.Text
See #13414
1 parent 2fce0ba commit 5320231

6 files changed

+8
-1
lines changed

resources/images/images_golden_integration_test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ Home.
252252
"linespacing" 8
253253
"size" 28
254254
"x" (div $sunset.Width 2 | int)
255+
"y" (div $sunset.Height 2 | int)
255256
"alignx" "center"
256-
"y" 190
257257
}}
258258
259259
{{ $text := "Pariatur deserunt sunt nisi sunt tempor quis eu. Sint et nulla enim officia sunt cupidatat. Eu amet ipsum qui velit cillum cillum ad Lorem in non ad aute." }}
@@ -262,6 +262,11 @@ Home.
262262
{{ template "filters" (dict "name" "text_alignx-right.jpg" "img" $sunset "filters" (images.Text $text $textOpts )) }}
263263
{{ $textOpts = (dict "alignx" "left") | merge $textOpts }}
264264
{{ template "filters" (dict "name" "text_alignx-left.jpg" "img" $sunset "filters" (images.Text $text $textOpts )) }}
265+
{{ $textOpts = (dict "alignx" "center" "aligny" "center") | merge $textOpts }}
266+
{{ $text = "Est exercitation deserunt exercitation nostrud magna. Eiusmod anim deserunt sit elit dolore ea incididunt nisi. Ea ullamco excepteur voluptate occaecat duis pariatur proident cupidatat. Eu id esse qui consectetur commodo ad ex esse cupidatat velit duis cupidatat. Aliquip irure tempor consequat non amet in mollit ipsum officia tempor laborum." }}
267+
{{ template "filters" (dict "name" "text_alignx-center_aligny-center.jpg" "img" $sunset "filters" (images.Text $text $textOpts )) }}
268+
{{ $textOpts = (dict "alignx" "center" "aligny" "bottom") | merge $textOpts }}
269+
{{ template "filters" (dict "name" "text_alignx-center_aligny-bottom.jpg" "img" $sunset "filters" (images.Text $text $textOpts )) }}
265270
266271
{{ define "filters"}}
267272
{{ if lt (len (path.Ext .name)) 4 }}
@@ -279,6 +284,8 @@ Home.
279284
opts.T = t
280285
opts.Name = name
281286
opts.Files = files
287+
// opts.WriteFiles = true
288+
// opts.DevMode = true
282289

283290
imagetesting.RunGolden(opts)
284291
}
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)