Skip to content

Commit 69bba9f

Browse files
committed
chore - update tests with the re-added backwards compatible priorities, fix conflicts
1 parent ea419a3 commit 69bba9f

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

pkg/models/priority.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const (
1717
var priorityToInt = map[string]int{
1818
PriorityUnknown: 0,
1919
PriorityInformational: 1,
20-
PriorityImportant: 4,
21-
PriorityUrgent: 5,
20+
PriorityImportant: 3,
21+
PriorityUrgent: 4,
2222

2323
// To be deprecated
2424
PriorityNegligible: 1,
25-
PriorityLow: 2,
26-
PriorityMedium: 3,
25+
PriorityLow: 1,
26+
PriorityMedium: 2,
2727
}
2828

2929
func ComparePriority(priority1, priority2 string) int {

pkg/models/priority_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,32 @@ func TestComparePriority(t *testing.T) {
2424
{"NONE", "UNKNOWN", 0},
2525
{"UNKNOWN", "", 0},
2626
{"", "UNKNOWN", 0},
27+
28+
// To be deprecated, for backwards compatibility
29+
{"NEGIGIBLE", "URGENT", -1},
30+
{"NEGIGIBLE", "IMPORTANT", -1},
31+
{"NEGIGIBLE", "INFORMATIONAL", 0},
32+
{"NEGIGIBLE", "UNKNOWN", 1},
33+
{"NEGIGIBLE", "NONE", 1},
34+
{"NEGIGIBLE", "", 1},
35+
{"", "NEGIGIBLE", -1},
36+
{"NEGIGIBLE", "NEGIGIBLE", 0},
37+
{"LOW", "URGENT", -1},
38+
{"LOW", "IMPORTANT", -1},
39+
{"LOW", "INFORMATIONAL", 0},
40+
{"LOW", "UNKNOWN", 1},
41+
{"LOW", "NONE", 1},
42+
{"LOW", "", 1},
43+
{"", "LOW", -1},
44+
{"LOW", "LOW", 0},
45+
{"MEDIUM", "URGENT", -1},
46+
{"MEDIUM", "IMPORTANT", -1},
47+
{"MEDIUM", "INFORMATIONAL", 1},
48+
{"MEDIUM", "UNKNOWN", 1},
49+
{"MEDIUM", "NONE", 1},
50+
{"MEDIUM", "", 1},
51+
{"", "MEDIUM", -1},
52+
{"MEDIUM", "MEDIUM", 0},
2753
}
2854

2955
for _, test := range tests {

0 commit comments

Comments
 (0)