Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for creating column with description
Browse files Browse the repository at this point in the history
Benedict Homuth committed Jul 24, 2024
1 parent 5992e92 commit 3bcb861
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions server/src/database/columns_test.go
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ func TestRunnerForColumns(t *testing.T) {
t.Run("Create=3", testCreateColumnWithExceptionallyHighIndex)
t.Run("Create=4", testCreateColumnWithEmptyName)
t.Run("Create=5", testCreateColumnWithEmptyColor)
t.Run("Create=6", testCreateColumnWithDescription)

t.Run("Delete=0", testCreateColumnOnSecondIndex)
t.Run("Delete=1", testDeleteColumnOnSecondIndex)
@@ -181,6 +182,22 @@ func testCreateColumnWithEmptyColor(t *testing.T) {
assert.NotNil(t, err)
}

func testCreateColumnWithDescription(t *testing.T) {
aDescription := "A description"
column, err := testDb.CreateColumn(ColumnInsert{
Board: boardForColumnsTest,
Name: "Column",
Color: types.ColorBacklogBlue,
Description: aDescription,
})
assert.Nil(t, err)
assert.NotNil(t, column)
assert.Equal(t, aDescription, column.Description)

// clean up to not crash other tests
_ = testDb.DeleteColumn(boardForColumnsTest, column.ID, uuid.New())
}

func testDeleteColumnOnSecondIndex(t *testing.T) {
err := testDb.DeleteColumn(boardForColumnsTest, columnInsertedFifth.ID, columnTestUser.ID)
assert.Nil(t, err)

0 comments on commit 3bcb861

Please sign in to comment.