Skip to content

Commit

Permalink
default api coverage for cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed Sep 22, 2023
1 parent 6656f63 commit 3a5631e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cypress/cypress/fixtures/mentor/orphaned_answer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
This software is Copyright ©️ 2020 The University of Southern California. All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and subject to the full license file found in the root of this software deliverable. Permission to make commercial use of this software may be obtained by contacting: USC Stevens Center for Innovation University of Southern California 1150 S. Olive Street, Suite 2300, Los Angeles, CA 90115, USA Email: [email protected]
The full terms of this copyright and license should always be found in the root directory of this software deliverable as "license.txt" and if these terms are not found with this software, please contact the USC Stevens Center for the full license.
*/
import { Answer, QuestionType, Status } from "../../support/types";

export const orphanedAnswer: Answer = {
previousVersions: [],
_id: "A9_9_9",
question: {
_id: "A9_9_9",
clientId: "C_A9_9_9",
question: "Orphaned Question",
type: QuestionType.QUESTION,
name: null,
paraphrases: [],
},
transcript: "Orphaned transcript",
status: Status.COMPLETE,
};
3 changes: 3 additions & 0 deletions cypress/cypress/support/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { TaskStatus, UserAccessToken } from "./types";
import questions from "../fixtures/questions";
import { encodedSentences } from "../fixtures/feedback/trendingFeedbackEncodedResults";
import { v4 as uuid } from "uuid";
import { orphanedAnswer } from "../fixtures/mentor/orphaned_answer";

const TRAIN_STATUS_URL = `/train/status`;
const UPLOAD_STATUS_URL = `/upload/answer/status`;
Expand Down Expand Up @@ -333,6 +334,8 @@ export function cyMockDefault(
mockGQL("UpdateMentorDetails", { me: { updateMentorDetails: true } }),
mockGQL("UpdateMentorKeywords", { me: { updateMentorKeywords: true } }),
mockGQL("UpdateMentorPrivacy", { me: { updateMentorPrivacy: true } }),
mockGQL("FetchMentorConfig", { fetchMentorConfig: {} }),
mockGQL("Answer", { answer: orphanedAnswer }),
]);
}

Expand Down
27 changes: 27 additions & 0 deletions cypress/cypress/support/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,35 @@ export interface UserAccessToken {
expirationDate: string;
}

export enum OrgViewPermissionType {
NONE = "NONE", // no custom settings, use "isPrivate"
HIDDEN = "HIDDEN", // org cannot see or use mentor
SHARE = "SHARE", // org can use mentor as-is
}

export enum OrgEditPermissionType {
NONE = "NONE", // no custom settings, use "isPrivate"
MANAGE = "MANAGE", // org can edit content
ADMIN = "ADMIN", // org can edit content and edit sharing settings
}

export interface OrgPermissionsGQL {
org: string;
viewPermission: OrgViewPermissionType;
editPermission: OrgEditPermissionType;
}

export interface MentorConfig {
configId: string;
subjects: string[];
publiclyVisible: boolean;
mentorType: MentorType;
orgPermissions: OrgPermissionsGQL[];
loginHeaderText: string;
welcomeSlideHeader: string;
welcomeSlideText: string;
disableMyGoalSlide: boolean;
disableFollowups: boolean;
}

export interface Mentor {
Expand Down

0 comments on commit 3a5631e

Please sign in to comment.