Skip to content

Commit

Permalink
Do not fail if empty description
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Jan 23, 2025
1 parent 8158f78 commit fbcfe36
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait LearningPathValidator {
this: LanguageValidator & TitleValidator & TextValidator =>
val learningPathValidator: LearningPathValidator

class LearningPathValidator(descriptionRequired: Boolean = true) {
class LearningPathValidator(descriptionRequired: Boolean = false) {

private val MISSING_DESCRIPTION = "At least one description is required."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@ class LearningPathValidatorTest extends UnitSuite with TestEnvironment {
validationError.head.message should equal("The url to the coverPhoto must point to an image in NDLA Image API.")
}

test("That validate returns error message when no descriptions are defined") {
validMock()
val errorMessages =
validator.validateLearningPath(ValidLearningPath.copy(description = List()), allowUnknownLanguage = false)
errorMessages.size should be(1)
errorMessages.head.field should equal("description")
errorMessages.head.message should equal("At least one description is required.")
}

test(
"That validate does not return error message when no descriptions are defined and no descriptions are required"
) {
Expand Down

0 comments on commit fbcfe36

Please sign in to comment.