// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-present Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see
Card Description bold
\n", BucketID: 1, KanbanPosition: 123, DueDate: time1, Labels: []*models.Label{ { Title: "Label 1", HexColor: trelloColorMap["green"], }, { Title: "Label 2", HexColor: trelloColorMap["orange"], }, }, Attachments: []*models.TaskAttachment{ { File: &files.File{ Name: "Testimage.jpg", Mime: "image/jpg", Size: uint64(len(exampleFile)), FileContent: exampleFile, }, }, }, }, }, { Task: models.Task{ Title: "Test Card 2", Description: ` ## Checkproject 1 * [ ] Pending Task * [x] Completed Task ## Checkproject 2 * [ ] Pending Task * [ ] Another Pending Task`, BucketID: 1, KanbanPosition: 124, }, }, { Task: models.Task{ Title: "Test Card 3", BucketID: 1, KanbanPosition: 126, }, }, { Task: models.Task{ Title: "Test Card 4", BucketID: 1, KanbanPosition: 127, Labels: []*models.Label{ { Title: "Label 2", HexColor: trelloColorMap["orange"], }, }, }, }, { Task: models.Task{ Title: "Test Card 5", BucketID: 2, KanbanPosition: 111, Labels: []*models.Label{ { Title: "Label 3", HexColor: trelloColorMap["blue"], }, }, }, }, { Task: models.Task{ Title: "Test Card 6", BucketID: 2, KanbanPosition: 222, DueDate: time1, }, }, { Task: models.Task{ Title: "Test Card 7", BucketID: 2, KanbanPosition: 333, }, }, { Task: models.Task{ Title: "Test Card 8", BucketID: 2, KanbanPosition: 444, }, }, }, }, { Project: models.Project{ ID: 3, ParentProjectID: 1, Title: "TestBoard 2", }, Buckets: []*models.Bucket{ { ID: 3, Title: "Test Project 4", }, }, Tasks: []*models.TaskWithComments{ { Task: models.Task{ Title: "Test Card 634", BucketID: 3, KanbanPosition: 123, }, }, }, }, { Project: models.Project{ ID: 4, ParentProjectID: 1, Title: "TestBoard Archived", IsArchived: true, }, Buckets: []*models.Bucket{ { ID: 4, Title: "Test Project 5", }, }, Tasks: []*models.TaskWithComments{ { Task: models.Task{ Title: "Test Card 63423", BucketID: 4, KanbanPosition: 123, }, }, }, }, } hierachie, err := convertTrelloDataToVikunja(trelloData, "") require.NoError(t, err) assert.NotNil(t, hierachie) if diff, equal := messagediff.PrettyDiff(hierachie, expectedHierachie); !equal { t.Errorf("converted trello data = %v, want %v, diff: %v", hierachie, expectedHierachie, diff) } }