|
| 1 | +import { mockFormat, mockCertificateData, mockCourse, mockLearningModule, mockRatingCriteria } from "./course"; |
| 2 | +import { mockCommunity, mockMetadata } from "./community"; |
| 3 | +import { reward } from "./reward"; |
| 4 | +import { Evaluation, Submission } from "@/types/bounty"; |
| 5 | +import { AdditionalInfo, Challenge } from "@/types/course"; |
| 6 | +import { GRADING_CRITERIA, TEAM_FORMATION } from "@/constants/challengeInfo"; |
| 7 | +import { Team, TeamMember } from "@/types/challenge"; |
| 8 | +import { Feedback } from "@/types/feedback"; |
| 9 | +import { mockUser } from "./user"; |
| 10 | + |
| 11 | +export const mockAdditionalInfo: { [type: string]: AdditionalInfo } = { |
| 12 | + type: { type: "additional type", text: "additional text" }, |
| 13 | +}; |
| 14 | + |
| 15 | +export const challenge: Challenge = { |
| 16 | + id: "challenge", |
| 17 | + ref: "challenge ref", |
| 18 | + created_at: new Date("2022-05-01T12:00:00Z"), |
| 19 | + updated_at: new Date("2022-05-01T12:00:00Z"), |
| 20 | + hint: "Hint", |
| 21 | + name: "challenge name", |
| 22 | + format: mockFormat, |
| 23 | + description: "challenge description", |
| 24 | + course: mockCourse, |
| 25 | + type: "course", |
| 26 | + isTeamChallenge: false, |
| 27 | + objectives: ["objectives 1", "Objectives 2", "Objectives 3", "Objectives 4"], |
| 28 | + threshold: 8, |
| 29 | + community: mockCommunity, |
| 30 | + reviewTime: 9, |
| 31 | + metadata: mockMetadata, |
| 32 | + level: 58, |
| 33 | + courses: [mockCourse], |
| 34 | + learningModules: [mockLearningModule], |
| 35 | + expiresAt: "2025", |
| 36 | + reward: reward, |
| 37 | + certificateIcon: "certificate", |
| 38 | + certificateData: mockCertificateData, |
| 39 | + ratingCriteria: [mockRatingCriteria], |
| 40 | + timestamp: 6, |
| 41 | + maxPoints: 299, |
| 42 | + minPoints: 9, |
| 43 | + rewards: [reward], |
| 44 | + feedbacks: {}, |
| 45 | + feedbackInfo: [{}], |
| 46 | + bestSubmissions: [{}], |
| 47 | + teamLimit: 5, |
| 48 | + isHackathon: false, |
| 49 | + additionalInfo: { |
| 50 | + [TEAM_FORMATION]: { |
| 51 | + type: "teamFormation", |
| 52 | + text: "Form your team details here", |
| 53 | + }, |
| 54 | + [GRADING_CRITERIA]: { type: "teamFormation", text: "Sample grading criteria text" }, |
| 55 | + }, |
| 56 | +}; |
| 57 | +export const evaluation: Evaluation = { |
| 58 | + evaluator: mockUser, |
| 59 | + created_at: new Date("2022-05-01T12:00:00Z"), |
| 60 | + comment: "comment", |
| 61 | + criteria: [], |
| 62 | + metadata: { |
| 63 | + language: "language", |
| 64 | + }, |
| 65 | + points: 10, |
| 66 | + totalPoints: 1, |
| 67 | + reward: { |
| 68 | + amount: 10, |
| 69 | + token: "token", |
| 70 | + }, |
| 71 | +}; |
| 72 | + |
| 73 | +export const submission: Submission = { |
| 74 | + length: 0, |
| 75 | + id: "submission_id", |
| 76 | + ref: "reference", |
| 77 | + created_at: new Date("2022-05-01T12:00:00Z"), |
| 78 | + updated_at: new Date("2022-05-01T12:00:00Z"), |
| 79 | + link: "/submissions/reference", |
| 80 | + community: mockCommunity, |
| 81 | + user_id: "user_id", |
| 82 | + challenge: challenge, |
| 83 | + text: "Submission", |
| 84 | + reviewDeadline: new Date(), |
| 85 | + metadata: { |
| 86 | + applicableReward: { |
| 87 | + ref: "", |
| 88 | + amount: 0, |
| 89 | + updated_at: "", |
| 90 | + challenge: "", |
| 91 | + created_at: "", |
| 92 | + id: "", |
| 93 | + type: "", |
| 94 | + community: "", |
| 95 | + timestamp: 0, |
| 96 | + token: "", |
| 97 | + }, |
| 98 | + reviewed: false, |
| 99 | + feedbacks: 0, |
| 100 | + language: "", |
| 101 | + evaluation: { |
| 102 | + points: 8, |
| 103 | + reward: reward, |
| 104 | + score: 80, |
| 105 | + totalPoints: 10, |
| 106 | + }, |
| 107 | + }, |
| 108 | + evaluation: evaluation, |
| 109 | + timestamp: 0, |
| 110 | + user: mockUser, |
| 111 | + reviewable: false, |
| 112 | + status: "", |
| 113 | + reward: reward, |
| 114 | + map: () => { |
| 115 | + throw new Error("Function not implemented."); |
| 116 | + }, |
| 117 | +}; |
| 118 | + |
| 119 | +export const mockInvite = { |
| 120 | + created_at: new Date().toISOString(), |
| 121 | + id: "invite", |
| 122 | + ref: "invitation ref", |
| 123 | + status: "invitation status", |
| 124 | + team_ref: "team reference", |
| 125 | + timestamp: 3, |
| 126 | + updated_at: new Date().toISOString(), |
| 127 | + user: mockUser, |
| 128 | + user_id: "user id", |
| 129 | +}; |
| 130 | + |
| 131 | +export const mockTeamMember: TeamMember = { |
| 132 | + created_at: new Date().toISOString(), |
| 133 | + id: "id", |
| 134 | + joined_on: "joined_on", |
| 135 | + ref: "ref", |
| 136 | + team_ref: "team reference", |
| 137 | + timestamp: 3, |
| 138 | + updated_at: new Date().toISOString(), |
| 139 | + user: mockUser, |
| 140 | +}; |
| 141 | + |
| 142 | +export const mockTeam: Team = { |
| 143 | + challenge: challenge, |
| 144 | + challenge_ref: "challenge ref", |
| 145 | + created_at: new Date().toISOString(), |
| 146 | + id: "id", |
| 147 | + locked: true, |
| 148 | + name: "Master", |
| 149 | + organizer: mockUser, |
| 150 | + organizer_id: "organizer id", |
| 151 | + invites: [mockInvite], |
| 152 | + members: [mockTeamMember], |
| 153 | + ref: "", |
| 154 | + timestamp: "", |
| 155 | + updated_at: new Date().toISOString(), |
| 156 | +}; |
| 157 | + |
| 158 | +export const mockFeedback: Feedback = { |
| 159 | + submission: submission, |
| 160 | + id: "234-4231243", |
| 161 | + ref: "feedbacks/234-4231243", |
| 162 | + created_at: new Date(), |
| 163 | + updated_at: "", |
| 164 | + criteria: ["criteria 1", "criteria 2"], |
| 165 | + positive: false, |
| 166 | + name: "The person who made a submission", |
| 167 | + challenge: "challenge name", |
| 168 | + timestamp: undefined, |
| 169 | + user: mockUser, |
| 170 | + ranking: 0, |
| 171 | + text: "I am providing a feedback", |
| 172 | +}; |
0 commit comments