-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
deletionDate
to relationship's deletion info (#290)
* feat: add deletion date to the deletion info of an relationship * chore: remove test for the deletion date to be in the future * chore: make deletion date not optional * chore: add deletionDate from PeerDeleted external event * chore: fix PeerDeletedExternalEventProcessor test * chore: add default for deletionDate * chore: add test for default deletionDate * chore: split PeerDeletionInfo tests * test: add test for saving the deletionDate via external event * chore: add switch case * chore: remove test state * fix: overwriting of deletiong date * test: use same date object in external event processor test * chore: consisten indentation * chore: consisten indentation * chore: short hand declaration --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6a46d44
commit 52f42e7
Showing
12 changed files
with
84 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
20 changes: 20 additions & 0 deletions
20
packages/transport/test/modules/relationships/PeerDeletionInfo.test.ts
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,20 @@ | ||
import { CoreDate } from "@nmshd/core-types"; | ||
import { PeerDeletionInfo, PeerDeletionStatus } from "../../../src"; | ||
|
||
describe("PeerDeletionInfo", () => { | ||
test("PeerDeletionInfo in status ToBeDeleted should have a default deletionDate in the Future", () => { | ||
const peerDeletionInfoToBeDeleted = PeerDeletionInfo.fromAny({ | ||
deletionStatus: PeerDeletionStatus.ToBeDeleted | ||
}); | ||
|
||
expect(peerDeletionInfoToBeDeleted.deletionDate.isAfter(CoreDate.local())).toBeTruthy(); | ||
}); | ||
|
||
test("PeerDeletionInfo in status Deleted should have a default deletionDate now or in the past", () => { | ||
const peerDeletionInfoDeleted = PeerDeletionInfo.fromAny({ | ||
deletionStatus: PeerDeletionStatus.Deleted | ||
}); | ||
|
||
expect(peerDeletionInfoDeleted.deletionDate.isSameOrBefore(CoreDate.local())).toBeTruthy(); | ||
}); | ||
}); |
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