Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
add more test data
Browse files Browse the repository at this point in the history
  • Loading branch information
ingbyr committed Sep 5, 2022
1 parent 6406487 commit c21f0e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 11 additions & 7 deletions group/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ func TestGroupService_Save(t *testing.T) {
gs := NewService()
groups := []Group{
{ID: 1, Parent: 0, Name: "g-1", Desc: "desc1"},
{ID: 11, Parent: 1, Name: "g-1-1", Desc: "desc11"},
{ID: 111, Parent: 11, Name: "g-1-1-1", Desc: "desc111"},
{ID: 112, Parent: 11, Name: "g-1-1-2", Desc: "desc112"},
{ID: 12, Parent: 1, Name: "g-1-2", Desc: "desc12"},
{ID: 13, Parent: 1, Name: "g-1-3", Desc: "desc13"},
{ID: 131, Parent: 13, Name: "g-1-3-1", Desc: "desc131"},
{ID: 132, Parent: 13, Name: "g-1-3-2", Desc: "desc132"},
{ID: 2, Parent: 0, Name: "g-2", Desc: "desc2"},
{ID: 3, Parent: 1, Name: "g-1-1", Desc: "desc3"},
{ID: 4, Parent: 3, Name: "g-1-1-1", Desc: "desc4"},
{ID: 5, Parent: 3, Name: "g-1-1-2", Desc: "desc5"},
{ID: 6, Parent: 1, Name: "g-1-2", Desc: "desc6"},
{ID: 7, Parent: 1, Name: "g-1-3", Desc: "desc7"},
{ID: 8, Parent: 0, Name: "g-3", Desc: "desc8"},
{ID: 9, Parent: 0, Name: "g-4", Desc: "desc9"},
{ID: 3, Parent: 0, Name: "g-3", Desc: "desc3"},
{ID: 31, Parent: 3, Name: "g-3-1", Desc: "desc31"},
{ID: 32, Parent: 3, Name: "g-3-2", Desc: "desc32"},
{ID: 4, Parent: 0, Name: "g-4", Desc: "desc4"},
}
for _, g := range groups {
if err := gs.Save(g); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions tui/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
tea "github.com/charmbracelet/bubbletea"
"gohost/group"
"io"
"strconv"
"strings"
)

Expand Down Expand Up @@ -105,7 +104,6 @@ func (v *GroupView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

func (v *GroupView) View() string {
v.groupList.Title = strconv.Itoa(v.selectedIndex)
return v.groupList.View()
}

Expand Down

0 comments on commit c21f0e0

Please sign in to comment.