File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ func (a Action) String() (s string) {
141141 case ActionSubmitted :
142142 return "submitted"
143143 case ActionDismissed :
144- return "dismisssed "
144+ return "dismissed "
145145 case ActionAssigned :
146146 return "assigned"
147147 case ActionUnassigned :
@@ -205,6 +205,14 @@ func (a *Action) UnmarshalJSON(data []byte) error {
205205 * a = ActionDismissed
206206 case "edited" :
207207 * a = ActionEdited
208+ case "assigned" :
209+ * a = ActionAssigned
210+ case "unassigned" :
211+ * a = ActionUnassigned
212+ case "review_requested" :
213+ * a = ActionReviewRequested
214+ case "review_request_removed" :
215+ * a = ActionReviewRequestRemoved
208216 }
209217 return nil
210218}
Original file line number Diff line number Diff line change @@ -25,3 +25,24 @@ func TestStateJSON(t *testing.T) {
2525 })
2626 }
2727}
28+
29+ func TestActionJSON (t * testing.T ) {
30+ for i := ActionCreate ; i < ActionCompleted ; i ++ {
31+ in := i
32+ t .Run (in .String (), func (t * testing.T ) {
33+ b , err := json .Marshal (in )
34+ if err != nil {
35+ t .Fatal (err )
36+ }
37+
38+ var out Action
39+ if err := json .Unmarshal (b , & out ); err != nil {
40+ t .Fatal (err )
41+ }
42+
43+ if in != out {
44+ t .Errorf ("%s != %s" , in , out )
45+ }
46+ })
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments