Skip to content

Commit

Permalink
Fix linting and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kokerinks committed Jul 10, 2024
1 parent 2c304a4 commit bc48562
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/app/shared/issue-tables/dropdownfilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ export function applyDropdownFilter(
}

function isFilteredByAssignee(filter: Filter, issue: Issue): boolean {

if (issue.issueOrPr === 'Issue') {
return (filter.assignees.some((assignee) => issue.assignees.includes(assignee))
|| (filter.assignees.includes("Unassigned") && issue.assignees.length === 0));

} else if (issue.issueOrPr === 'PullRequest') {
return (filter.assignees.some((assignee) => issue.author === assignee)
|| (filter.assignees.includes("Unassigned") && issue.author === null));
// note that issue.author is never == null for PRs, but is left for semantic reasons

} else { // should never occur
return (
filter.assignees.some((assignee) => issue.assignees.includes(assignee)) ||
(filter.assignees.includes('Unassigned') && issue.assignees.length === 0)
);
} else if (issue.issueOrPr === 'PullRequest') {
return (
filter.assignees.some((assignee) => issue.author === assignee) || (filter.assignees.includes('Unassigned') && issue.author === null)
);
// note that issue.author is never == null for PRs, but is left for semantic reasons
} else {
// should never occur
throw new Error('Issue or PR is neither Issue nor PullRequest');
}

}
2 changes: 1 addition & 1 deletion tests/constants/filter.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const DEFAULT_FILTER: Filter = {
hiddenLabels: new Set<string>(),
deselectedLabels: new Set<string>(),
itemsPerPage: 20,
assignees: []
assignees: ['Unassigned']
};

export const CHANGED_FILTER: Filter = {
Expand Down

0 comments on commit bc48562

Please sign in to comment.