This commit is contained in:
@@ -3,6 +3,8 @@ package ui
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/gdamore/tcell/v2"
|
||||
)
|
||||
|
||||
func TestContainerOneBox(t *testing.T) {
|
||||
@@ -13,7 +15,7 @@ func TestContainerOneBox(t *testing.T) {
|
||||
└──────────────────┘
|
||||
`
|
||||
m := &MockScreen{}
|
||||
one := NewBox("box one", nil, Contents{}, 0, false)
|
||||
one := NewBox("box one", nil, Contents{}, tcell.Style{}, false)
|
||||
container := NewContainer(
|
||||
Contents{{Container: one}},
|
||||
LayoutHorizontalEven,
|
||||
@@ -38,8 +40,8 @@ func TestContainerTwoBoxesHStack(t *testing.T) {
|
||||
└────────┘└────────┘
|
||||
`
|
||||
m := &MockScreen{}
|
||||
one := NewBox("one", nil, Contents{}, 0, false)
|
||||
two := NewBox("two", nil, Contents{}, 0, false)
|
||||
one := NewBox("one", nil, Contents{}, tcell.Style{}, false)
|
||||
two := NewBox("two", nil, Contents{}, tcell.Style{}, false)
|
||||
container := NewContainer(
|
||||
Contents{{Container: one}, {Container: two}},
|
||||
LayoutHorizontalEven,
|
||||
@@ -64,9 +66,9 @@ func TestContainerThreeBoxesUnevenHStack(t *testing.T) {
|
||||
└────────┘└────────┘└───────┘
|
||||
`
|
||||
m := &MockScreen{}
|
||||
one := NewBox("one", nil, Contents{}, 0, false)
|
||||
two := NewBox("two", nil, Contents{}, 0, false)
|
||||
three := NewBox("three", nil, Contents{}, 0, false)
|
||||
one := NewBox("one", nil, Contents{}, tcell.Style{}, false)
|
||||
two := NewBox("two", nil, Contents{}, tcell.Style{}, false)
|
||||
three := NewBox("three", nil, Contents{}, tcell.Style{}, false)
|
||||
container := NewContainer(
|
||||
Contents{{Container: one}, {Container: two}, {Container: three}},
|
||||
LayoutHorizontalEven,
|
||||
@@ -91,8 +93,8 @@ func TestContainerTwoBoxesHPercentStack(t *testing.T) {
|
||||
└────────────┘└──────┘
|
||||
`
|
||||
m := &MockScreen{}
|
||||
one := NewBox("one", nil, Contents{}, 0, false)
|
||||
two := NewBox("two", nil, Contents{}, 0, false)
|
||||
one := NewBox("one", nil, Contents{}, tcell.Style{}, false)
|
||||
two := NewBox("two", nil, Contents{}, tcell.Style{}, false)
|
||||
container := NewContainer(
|
||||
Contents{
|
||||
{Container: one, Offsets: Offsets{Percent: 2}},
|
||||
@@ -124,8 +126,8 @@ func TestContainerTwoBoxesVStack(t *testing.T) {
|
||||
└────────┘
|
||||
`
|
||||
m := &MockScreen{}
|
||||
one := NewBox("one", nil, Contents{}, 0, false)
|
||||
two := NewBox("two", nil, Contents{}, 0, false)
|
||||
one := NewBox("one", nil, Contents{}, tcell.Style{}, false)
|
||||
two := NewBox("two", nil, Contents{}, tcell.Style{}, false)
|
||||
container := NewContainer(
|
||||
Contents{{Container: one}, {Container: two}},
|
||||
LayoutVerticalEven,
|
||||
@@ -155,8 +157,8 @@ func TestContainerTwoBoxesPercentageVStack(t *testing.T) {
|
||||
└────────┘
|
||||
`
|
||||
m := &MockScreen{}
|
||||
one := NewBox("one", nil, Contents{}, 0, false)
|
||||
two := NewBox("two", nil, Contents{}, 0, false)
|
||||
one := NewBox("one", nil, Contents{}, tcell.Style{}, false)
|
||||
two := NewBox("two", nil, Contents{}, tcell.Style{}, false)
|
||||
container := NewContainer(
|
||||
Contents{
|
||||
{Container: one, Offsets: Offsets{Percent: 2}},
|
||||
|
Reference in New Issue
Block a user