Handle the case when errors is a string

This commit is contained in:
Jean-Baptiste Bellet
2022-07-05 15:48:31 +02:00
parent d71994189c
commit b2a0310e6f
2 changed files with 7 additions and 3 deletions

View File

@@ -10,6 +10,9 @@ describe "ErrorsParser service", ->
it "returns empty string for nil errors", ->
expect(errorsParser.toString(null)).toEqual ""
it "returns string for string errors", ->
expect(errorsParser.toString("error")).toEqual "error"
it "returns the elements in the array if an array is provided", ->
expect(errorsParser.toString(["1", "2"])).toEqual "1\n2\n"