This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/ tests suites for business logic
- Loading branch information
1 parent
64d8992
commit e022d9b
Showing
8 changed files
with
72 additions
and
43 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,38 @@ | ||
import { StateAccount } from "../src/service/store/state/state-account"; | ||
import { ServiceStore } from "../src/service/store"; | ||
import connectGmail from "./__fixtures__/connectGmail"; | ||
import connectRetailer from "./__fixtures__/connectRetailer"; | ||
import fiveReceipts from "./__fixtures__/fiveReceipts"; | ||
import mockCheckPayout from "./__mocks__/mockCheckPayout"; | ||
|
||
describe("User misses a weekly login", () => { | ||
test("test suite", () => { | ||
const store = new ServiceStore(); | ||
const gmail = store.gmail as StateAccount; | ||
const retailer = store.retailer as StateAccount; | ||
|
||
store.sync.add(new Date("09/05/2023")); | ||
store.sync.add(new Date("09/12/2023")); | ||
store.sync.add(new Date("09/24/2023")); | ||
store.sync.add(new Date("10/01/2023")); | ||
const count = store.sync.countWeeks(new Date("10/02/2023")); | ||
|
||
expect(count).toBeLessThan(4); | ||
|
||
expect(connectGmail(gmail)).toBe("P100"); | ||
expect(connectRetailer(retailer)).toBe("P100"); | ||
expect(fiveReceipts(store.receipt)).toBe(5); | ||
expect(gmail.get().value).toBe("P100") | ||
expect(retailer.get().value).toBe("P100") | ||
expect(store.receipt.count()).toBe(5) | ||
|
||
expect( | ||
mockCheckPayout( | ||
count, | ||
store.receipt.count(), | ||
gmail.get().value, | ||
retailer.get().value | ||
) | ||
).toBeFalsy(); | ||
}); | ||
}); |
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