forked from cypress-io/cypress-realworld-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generateSeedData.test.ts
59 lines (50 loc) · 1.79 KB
/
generateSeedData.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import {
buildDatabase,
userbaseSize,
contactsPerUser,
totalTransactions,
bankAccountsPerUser,
totalLikes,
totalComments,
totalNotifications,
totalBankTransfers,
} from "../../scripts/seedDataUtils";
import { TDatabase } from "../../backend/database";
describe.skip("Seed Database", () => {
let database: TDatabase;
beforeEach(() => {
database = buildDatabase();
});
it("should contain a list of users", () => {
expect(database).toHaveProperty("users");
expect(database.users.length).toBe(userbaseSize);
});
it("should contain a list of contacts", () => {
expect(database).toHaveProperty("contacts");
expect(database.contacts.length).toBe(contactsPerUser * userbaseSize);
});
it("should contain a list of bankaccounts", () => {
expect(database).toHaveProperty("bankaccounts");
expect(database.bankaccounts.length).toBe(bankAccountsPerUser * userbaseSize);
});
it("should contain a list of transactions", () => {
expect(database).toHaveProperty("transactions");
expect(database.transactions.length).toBe(totalTransactions);
});
it("should contain a list of likes", () => {
expect(database).toHaveProperty("likes");
expect(database.likes.length).toBe(totalLikes);
});
it("should contain a list of comments", () => {
expect(database).toHaveProperty("comments");
expect(database.comments.length).toBe(totalComments);
});
it("should contain a list of notifications", () => {
expect(database).toHaveProperty("notifications");
expect(database.notifications.length).toBeGreaterThanOrEqual(totalNotifications);
});
it("should contain a list of bank transfers", () => {
expect(database).toHaveProperty("banktransfers");
expect(database.banktransfers.length).toBeLessThanOrEqual(totalBankTransfers);
});
});