Add trello boards with empty organization under a "Personal" project
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Elscrux 2024-04-07 14:32:39 +02:00
parent de31ffa899
commit a11af657a9
2 changed files with 22 additions and 0 deletions

View File

@ -124,6 +124,11 @@ func createOrganizationMap(trelloData []*trello.Board) map[string][]*trello.Boar
boardMap := make(map[string][]*trello.Board)
for _, board := range trelloData {
// Trello boards without an organization are considered personal boards
if board.IDOrganization == "" {
board.IDOrganization = "Personal"
}
boards, ok := boardMap[board.IDOrganization]
if ok {
boards = append(boards, board)

View File

@ -210,6 +210,20 @@ func getTestBoard(t *testing.T) ([]*trello.Board, time.Time) {
},
},
},
{
Name: "Personal Board",
Lists: []*trello.List{
{
Name: "Test Project 6",
Cards: []*trello.Card{
{
Name: "Test Card 5659",
Pos: 123,
},
},
},
},
},
}
trelloData[0].Prefs.BackgroundImage = "https://vikunja.io/testimage.jpg" // Using an image which we are hosting, so it'll still be up
@ -433,6 +447,9 @@ func TestCreateOrganizationMap(t *testing.T) {
"orgid2": {
trelloData[1],
},
"Personal": {
trelloData[3],
},
}
if diff, equal := messagediff.PrettyDiff(organizationMap, expectedMap); !equal {
t.Errorf("converted trello data = %v,\nwant %v,\ndiff: %v", organizationMap, expectedMap, diff)