-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for default and specific priority labels. Fix default 1.
- Loading branch information
1 parent
d9d29aa
commit dbf0ab3
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ContextPlugin } from "../src/types/plugin-input"; | ||
import { FormattingEvaluatorModule } from "../src/parser/formatting-evaluator-module"; | ||
import { GitHubIssue } from "../src/github-types"; | ||
import { describe, expect, it, jest } from "@jest/globals"; | ||
|
||
describe("FormattingEvaluatorModule", () => { | ||
const context = { | ||
config: { | ||
incentives: { | ||
formattingEvaluator: null, | ||
}, | ||
}, | ||
logger: { | ||
error: jest.fn(), | ||
}, | ||
} as unknown as ContextPlugin; | ||
|
||
const module = new FormattingEvaluatorModule(context); | ||
|
||
it("should default to priority 1 when no priority label is present", () => { | ||
const labels: GitHubIssue["labels"] = []; | ||
const priority = module["_parsePriorityLabel"](labels); | ||
expect(priority).toBe(1); | ||
}); | ||
|
||
it('should return priority 3 when "Priority: 3" label is present', () => { | ||
const labels = ["Priority: 3"]; | ||
const priority = module["_parsePriorityLabel"](labels); | ||
expect(priority).toBe(3); | ||
}); | ||
}); |