Skip to content

Commit

Permalink
Wrote a test and fixed red tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonia Heinen committed Jul 7, 2024
1 parent 35c807d commit 528239d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ testing
testCardLoad

| json card |
json := '{"closed":true,"assignees":[{"id":2,"login":"your cat"}],"title":"the title","id":11,"body":"the body","isNote":true,"labels":[{"id":2,"color":"0000FF","title":"Feature"}]}' parseAsJson.
json := '{"closed":true,"assignees":[{"id":2,"login":"your cat"}],"title":"the title","id":11,"body":"the body","isNote":true,"labels":[{"id":2,"color":"0000FF","name":"Feature"}]}' parseAsJson.
card := SPBCard new buildLocalCard: json.
self assert: card isClosed.
self assert: card title equals: 'the title'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ testing
testLabelLoad

| json label|
json := '{"title": "TODO", "id": 42, "color": "FF0000"}' parseAsJson.
json := '{"name": "TODO", "id": 42, "color": "FF0000"}' parseAsJson.
label := SPBLabel newFrom: json.
self assert: label title equals: 'TODO'.
self assert: label id equals: 42.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
},
"instance" : {
"testAssigneeLoad" : "FP 6/25/2024 11:16",
"testCardLoad" : "FP 7/2/2024 11:29",
"testLabelLoad" : "FP 7/2/2024 11:31" } }
"testCardLoad" : "AH 7/7/2024 17:14",
"testLabelLoad" : "AH 7/7/2024 17:14" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ testLabelToJson
| json |
json := self defaultLabel asJson.
self assert: 1234 equals: (json at: 'id').
self assert: 'this is a label' = (json at: 'title').
self assert: 'this is a label' = (json at: 'name').
self assert: 'FF0000' = (json at: 'color').
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"testBoardToJson" : "FP 7/4/2024 15:46",
"testCardToJson" : "FP 6/25/2024 11:54",
"testColumnToJson" : "FP 6/25/2024 15:34",
"testLabelToJson" : "FP 6/25/2024 11:29" } }
"testLabelToJson" : "AH 7/7/2024 17:14" } }
12 changes: 12 additions & 0 deletions Squello-Tests.package/SPBLabelTests.class/instance/testJson.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests
testJson

| json |
label color: Color red;
title: 'Hello World';
id: 42.
json:= label asJson.
self assert: (json at: 'name') equals: 'Hello World'.
self assert: (json at: 'id') equals: 42.
self assert: (json at: 'color') equals: 'FF0000'.
self assert: json size equals: 3.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"testColor" : "lo 5/23/2022 16:53",
"testHash" : "lo 6/5/2022 15:24",
"testId" : "lo 5/23/2022 16:55",
"testJson" : "AH 7/7/2024 17:18",
"testJsonWriteOn" : "NTK 7/23/2022 11:04",
"testTitle" : "lo 5/23/2022 16:56" } }

0 comments on commit 528239d

Please sign in to comment.