(hotfix) simplify expetion logic

This commit is contained in:
Robin Olsen
2026-03-05 11:36:09 +01:00
parent 4a023caebb
commit 28add3f4dd
2 changed files with 23 additions and 26 deletions

View File

@@ -74,28 +74,11 @@ func (t *CreateIssueTask) Validate(ctx context.Context) ValidationFeedback {
issue := issues[0]
expect.Assert(len(issues) < 2, "Multiple issues were created instead of one. Delete the extra issues and try again.")
expect.Assert(len(issues) < 2, "Multiple issues were created instead of one")
if issue.Title == "" {
expect.Fail("Issue title should not be empty, but it is empty")
} else {
expect.Assert(issue.Title == "My first Issue",
fmt.Sprintf("Issue title does not match the expected value 'My first Issue', but was '%s'", issue.Title))
}
if issue.Description == "" {
expect.Fail("Issue description should not be empty, but it is empty")
} else {
expect.Assert(issue.Description == "I need to do some coding",
fmt.Sprintf("Issue description does not match the expected value 'I need to do some coding', but was '%s'", issue.Description))
}
if issue.Assignee == "" {
expect.Fail("Issue should be assigned to 'Me', but it is not assigned to anyone")
} else {
expect.Assert(issue.Assignee == "Me",
fmt.Sprintf("Issue should be assigned to 'Me', but was assigned to '%s'", issue.Assignee))
}
expect.NotEmptyAndEqual(issue.Title, "My first Issue", "Issue title")
expect.NotEmptyAndEqual(issue.Description, "I need to do some coding", "Issue description")
expect.NotEmptyAndEqual(issue.Assignee, "Me", "Issue assignee")
expect.Assert(issue.Status == models.StatusInProgress,
fmt.Sprintf("Issue status should be 'In Progress', but was '%s'", issue.Status))