Skip to content

Commit 5fa69f1

Browse files
committed
Update test
1 parent f0eeb85 commit 5fa69f1

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

pkg/github/granular_tools_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,12 @@ func TestGranularUpdateIssueLabelsConfidence(t *testing.T) {
476476
"repo": "repo",
477477
"issue_number": float64(1),
478478
"labels": []any{
479-
map[string]any{"name": "bug", "confidence": "high"},
479+
map[string]any{"name": "bug", "confidence": "HIGH"},
480480
},
481481
},
482482
expectedReq: map[string]any{
483483
"labels": []any{
484-
map[string]any{"name": "bug", "confidence": "high"},
484+
map[string]any{"name": "bug", "confidence": "HIGH"},
485485
},
486486
},
487487
},
@@ -492,12 +492,12 @@ func TestGranularUpdateIssueLabelsConfidence(t *testing.T) {
492492
"repo": "repo",
493493
"issue_number": float64(1),
494494
"labels": []any{
495-
map[string]any{"name": "bug", "rationale": "Reports a crash", "confidence": "medium"},
495+
map[string]any{"name": "bug", "rationale": "Reports a crash", "confidence": "MEDIUM"},
496496
},
497497
},
498498
expectedReq: map[string]any{
499499
"labels": []any{
500-
map[string]any{"name": "bug", "rationale": "Reports a crash", "confidence": "medium"},
500+
map[string]any{"name": "bug", "rationale": "Reports a crash", "confidence": "MEDIUM"},
501501
},
502502
},
503503
},
@@ -528,7 +528,7 @@ func TestGranularUpdateIssueLabelsConfidence(t *testing.T) {
528528
require.NoError(t, err)
529529

530530
errorContent := getErrorResult(t, result)
531-
assert.Contains(t, errorContent.Text, "confidence must be one of: low, medium, high")
531+
assert.Contains(t, errorContent.Text, "confidence must be one of: LOW, MEDIUM, HIGH")
532532
return
533533
}
534534

@@ -742,12 +742,12 @@ func TestGranularUpdateIssueTypeConfidence(t *testing.T) {
742742
"repo": "repo",
743743
"issue_number": float64(1),
744744
"issue_type": "bug",
745-
"confidence": "high",
745+
"confidence": "HIGH",
746746
},
747747
expectedReq: map[string]any{
748748
"type": map[string]any{
749749
"value": "bug",
750-
"confidence": "high",
750+
"confidence": "HIGH",
751751
},
752752
},
753753
},
@@ -759,13 +759,13 @@ func TestGranularUpdateIssueTypeConfidence(t *testing.T) {
759759
"issue_number": float64(1),
760760
"issue_type": "feature",
761761
"rationale": "Asks for dark mode support",
762-
"confidence": "medium",
762+
"confidence": "MEDIUM",
763763
},
764764
expectedReq: map[string]any{
765765
"type": map[string]any{
766766
"value": "feature",
767767
"rationale": "Asks for dark mode support",
768-
"confidence": "medium",
768+
"confidence": "MEDIUM",
769769
},
770770
},
771771
},
@@ -776,12 +776,12 @@ func TestGranularUpdateIssueTypeConfidence(t *testing.T) {
776776
"repo": "repo",
777777
"issue_number": float64(1),
778778
"issue_type": "bug",
779-
"confidence": "low",
779+
"confidence": "LOW",
780780
},
781781
expectedReq: map[string]any{
782782
"type": map[string]any{
783783
"value": "bug",
784-
"confidence": "low",
784+
"confidence": "LOW",
785785
},
786786
},
787787
},
@@ -820,7 +820,7 @@ func TestGranularUpdateIssueTypeInvalidConfidence(t *testing.T) {
820820
"issue_type": "bug",
821821
"confidence": "very_high",
822822
},
823-
expectedErrText: "confidence must be one of: low, medium, high",
823+
expectedErrText: "confidence must be one of: LOW, MEDIUM, HIGH",
824824
},
825825
{
826826
name: "confidence wrong type",
@@ -1599,7 +1599,7 @@ func TestGranularSetIssueFields(t *testing.T) {
15991599
})
16001600

16011601
t.Run("successful set with confidence", func(t *testing.T) {
1602-
confidence := "high"
1602+
confidence := "HIGH"
16031603
matchers := []githubv4mock.Matcher{
16041604
githubv4mock.NewQueryMatcher(
16051605
struct {
@@ -1680,7 +1680,7 @@ func TestGranularSetIssueFields(t *testing.T) {
16801680
map[string]any{
16811681
"field_id": "FIELD_1",
16821682
"text_value": "hello",
1683-
"confidence": "high",
1683+
"confidence": "HIGH",
16841684
},
16851685
},
16861686
})
@@ -1709,11 +1709,11 @@ func TestGranularSetIssueFields(t *testing.T) {
17091709
result, err := handler(ContextWithDeps(context.Background(), deps), &request)
17101710
require.NoError(t, err)
17111711
textContent := getTextResult(t, result)
1712-
assert.Contains(t, textContent.Text, "confidence must be one of: low, medium, high")
1712+
assert.Contains(t, textContent.Text, "confidence must be one of: LOW, MEDIUM, HIGH")
17131713
})
17141714

17151715
t.Run("confidence is sent when supplied", func(t *testing.T) {
1716-
confidence := "high"
1716+
confidence := "HIGH"
17171717
matchers := []githubv4mock.Matcher{
17181718
githubv4mock.NewQueryMatcher(
17191719
struct {
@@ -1794,7 +1794,7 @@ func TestGranularSetIssueFields(t *testing.T) {
17941794
map[string]any{
17951795
"field_id": "FIELD_1",
17961796
"text_value": "hello",
1797-
"confidence": "high",
1797+
"confidence": "HIGH",
17981798
},
17991799
},
18001800
})

0 commit comments

Comments
 (0)