Skip to content

Commit 6f2ee15

Browse files
committed
include test
1 parent 72042d8 commit 6f2ee15

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/lib/github.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,31 @@ describe('getAutoUpdateCandidate()', () => {
561561
);
562562
});
563563

564+
test('filterPRsByIncludedLabels should be case-insensitive', () => {
565+
const prWithMixedCaseLabel = {
566+
...pullsList.data[0],
567+
labels: [{ name: 'Feature-Request' }],
568+
};
569+
const prWithDifferentLabel = {
570+
...pullsList.data[0],
571+
labels: [{ name: 'bug' }],
572+
};
573+
574+
const prs = [prWithMixedCaseLabel, prWithDifferentLabel];
575+
576+
// Simulate config with lowercase input
577+
core.getInput.mockImplementation((name) => {
578+
if (name === 'included_labels') return 'feature-request';
579+
return '';
580+
});
581+
582+
const filteredPRs = gitLib.filterPRsByIncludedLabels(prs);
583+
584+
// Verification
585+
expect(filteredPRs.length).toBe(1);
586+
expect(filteredPRs).toContain(prWithMixedCaseLabel);
587+
});
588+
564589
test('filterPRsByExcludedLabels should filter out PRs with excluded labels', () => {
565590
const prWithLabelA = {
566591
...pullsList.data[0],

0 commit comments

Comments
 (0)