Skip to content

Commit

Permalink
add TestRenderParentGradient for #1034
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Jul 23, 2024
1 parent aa22336 commit ff5b38f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"

"cogentcore.org/core/colors"
"cogentcore.org/core/colors/gradient"
"cogentcore.org/core/icons"
"cogentcore.org/core/styles"
"cogentcore.org/core/styles/units"
Expand Down Expand Up @@ -209,3 +210,18 @@ func TestRenderGridCenteredFrame(t *testing.T) {
})
b.AssertRender(t, "render/grid-centered-frame")
}

// For https://github.com/cogentcore/core/issues/1034
func TestRenderParentGradient(t *testing.T) {
b := NewBody()
b.Styler(func(s *styles.Style) {
s.Direction = styles.Row
s.Background = gradient.NewLinear().AddStop(colors.White, 0).AddStop(colors.Black, 1)
})
for range 3 {
NewFrame(b).Styler(func(s *styles.Style) {
s.Min.Set(units.Em(2))
})
}
b.AssertRender(t, "render/parent-gradient")
}

0 comments on commit ff5b38f

Please sign in to comment.