-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1028] fix: remove incorrectly appended filter yourself to drep dire…
…ctory
- Loading branch information
1 parent
84cd7bb
commit 348ece0
Showing
3 changed files
with
35 additions
and
4 deletions.
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,27 @@ | ||
import { DREP_DIRECTORY_FILTERS } from "./filters"; | ||
|
||
describe("DREP_DIRECTORY_FILTERS", () => { | ||
it("should exclude 'Yourself' from filters", () => { | ||
// Arrange | ||
const expectedFilters = [ | ||
{ | ||
key: "Active", | ||
label: "Active", | ||
}, | ||
{ | ||
key: "Inactive", | ||
label: "Inactive", | ||
}, | ||
{ | ||
key: "Retired", | ||
label: "Retired", | ||
}, | ||
]; | ||
|
||
// Act | ||
const actualFilters = DREP_DIRECTORY_FILTERS; | ||
|
||
// Assert | ||
expect(actualFilters).toEqual(expectedFilters); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import { DRepStatus } from "@/models"; | ||
|
||
export const DREP_DIRECTORY_FILTERS = Object.values(DRepStatus).map((status) => ({ | ||
key: status, | ||
label: status, | ||
})); | ||
export const DREP_DIRECTORY_FILTERS = Object.values(DRepStatus) | ||
// `Yourself` should be excluded from filters | ||
.filter((status) => status !== DRepStatus.Yourself) | ||
.map((status) => ({ | ||
key: status, | ||
label: status, | ||
})); |