This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added basic testing for storables
- Loading branch information
1 parent
a58c7d8
commit 48a8214
Showing
2 changed files
with
17 additions
and
1 deletion.
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,16 @@ | ||
import { Storable } from "@/state/store/Storable" | ||
import { Timestamp } from '@firebase/firestore' | ||
|
||
describe('Storable', () => { | ||
it('Should always have an id', () => { | ||
const storable = new Storable('id') | ||
expect(storable.id).toBeDefined(); | ||
}) | ||
it('Should be comparable to another Storable with a flowTime', () => { | ||
const storable1 = new Storable('id1') | ||
const storable2 = new Storable('id2') | ||
storable1.docData = { updated: new Timestamp(1, 1) } | ||
storable2.docData = { updated: new Timestamp(2, 2) } | ||
expect(storable1.compareFlowTime(storable2)).toBe(-1) | ||
}) | ||
}) |