Skip to content

Commit c28bc40

Browse files
feat: create mocks for the api calls
1 parent 4ad0173 commit c28bc40

34 files changed

+288
-72
lines changed

__mocks__/bounty.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

__mocks__/fixtures/bounty.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { Bounty, BountyCourse } from "@/types/bounty";
2+
import { colors } from "./colors";
3+
import { metadata } from "./community";
4+
5+
export const mockBountyCourse: BountyCourse = {
6+
duration: 0,
7+
slug: "intoduction-to-blockchain",
8+
active: false,
9+
id: "123",
10+
ref: "courses/123",
11+
created_at: new Date(),
12+
updated_at: new Date(),
13+
summary: "this is a course",
14+
level: 0,
15+
name: "introduction to blockchain",
16+
description: "",
17+
objectives: [],
18+
locale: "",
19+
community: "icp",
20+
introduction: {
21+
text: "Introduction"
22+
},
23+
certificateIcon: "",
24+
certificateData: {
25+
narrative: "",
26+
icon: ""
27+
},
28+
timestamp: 0,
29+
learningModules: [],
30+
translations: []
31+
}
32+
export const mockBounty: Bounty = {
33+
url: "",
34+
image: undefined,
35+
id: "",
36+
ref: "",
37+
created_at: "",
38+
updated_at: "",
39+
icon: "",
40+
active: false,
41+
colors,
42+
description: "",
43+
summary: "",
44+
name: "",
45+
slug: "",
46+
metadata,
47+
timestamp: 0,
48+
course: mockBountyCourse,
49+
challenge: "",
50+
reward: {
51+
id: "",
52+
ref: "",
53+
created_at: new Date(),
54+
updated_at: new Date(),
55+
challenge: "",
56+
type: "",
57+
community: "",
58+
token: "",
59+
stable: false,
60+
fiatCurrency: undefined,
61+
amount: 0,
62+
timestamp: 0,
63+
distribution: undefined
64+
},
65+
community: ""
66+
}
67+
export const mockTrailer = {
68+
summary: "trailer summary",
69+
description: "trailer descriptio",
70+
video: "trailer video",
71+
duration: 4,
72+
info: {
73+
items: ["item 1", "item 2"],
74+
title: "info title",
75+
},
76+
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

__mocks__/profile.ts renamed to __mocks__/fixtures/profile.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,4 @@ export const mockReputation: Reputation = {
3939
score: 0
4040
}
4141

42-
export const userProfile = {
43-
displayName: "Jonh Doe",
44-
username: "Jonh Doe",
45-
avatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
46-
};
47-
4842
export const userIcon = "https://dacade.org/img/communities/sui.svg";

__mocks__/referrals.ts renamed to __mocks__/fixtures/referrals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { mockUser } from "./user";
88
const referralSubmission = () => Object.assign(getMockSubmission, { challengeData: challenge, link: "referral-link" });
99
const userReferral: UserReferral = Object.assign(mockUser, { submissions: [referralSubmission()] });
1010

11-
export const mockReferral = (): Referral => ({
11+
export const mockReferral: Referral = {
1212
id: "",
1313
name: "",
1414
ref: "",
@@ -22,4 +22,4 @@ export const mockReferral = (): Referral => ({
2222
submissions: [getMockSubmission],
2323
rewarded: false,
2424
user: userReferral,
25-
});
25+
};

0 commit comments

Comments
 (0)