-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We'll say that an item is only removed if it (1) has an "in_source" annotation and it is false. This annotation should always be present for metrics, but is not currently set for any other object.
- Loading branch information
Showing
6 changed files
with
35 additions
and
17 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
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
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,25 @@ | ||
import { isExpired, isRemoved } from "../src/state/items"; | ||
|
||
describe("checking if a date has expired", () => { | ||
it("returns True if input is 'never' or undefined", () => { | ||
expect(isExpired("never") || isExpired(undefined)).toEqual(false); | ||
}); | ||
it("returns True if input is a date from the past", () => { | ||
expect(isExpired("2021-01-01")).toEqual(true); | ||
}); | ||
it("returns False if input is a date from the future", () => { | ||
expect(isExpired("3021-01-01")).toEqual(false); | ||
}); | ||
}); | ||
|
||
describe("isRemoved works as expected", () => { | ||
it("returns true if in_source is false", () => { | ||
expect(isRemoved({ in_source: false })).toEqual(true); | ||
}); | ||
it("returns false if in_source is undefined", () => { | ||
expect(isRemoved({})).toEqual(false); | ||
}); | ||
it("returns false if in_source is true", () => { | ||
expect(isRemoved({ in_source: true })).toEqual(false); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.