Fix some code in the cypress tests

This commit is contained in:
Ramon Wenger 2021-06-06 18:53:16 +02:00
parent 6646b328b7
commit 25d08f2c09
5 changed files with 60 additions and 54 deletions

View File

@ -1,4 +1,4 @@
// import * as schema from '../fixtures/schema.json';
import {getModules, getMe} from '../../support/helpers';
import mocks from '../../fixtures/mocks';

View File

@ -1,4 +1,3 @@
// const schema = require('../../fixtures/schema.json');
const assignments = require('../../fixtures/assignments.json');
const mePayload = require('../../fixtures/me.join-class.json');
const topics = require('../../fixtures/topics.json');

View File

@ -1,5 +1,3 @@
// const schema = require('../../fixtures/schema.json');
const operations = {
ProjectsQuery: {
projects: {

View File

@ -1,6 +1,6 @@
#import "./schoolClassParts.gql"
#import "./moduleParts.gql"
fragment UserParts on UserNode {
fragment UserParts on PrivateUserNode {
id
pk
username

View File

@ -135,7 +135,7 @@ type AddRoomPayload {
type AnswerNode implements Node {
id: ID!
owner: UserNode!
owner: PrivateUserNode!
data: JSONString!
survey: SurveyNode!
pk: Int
@ -178,7 +178,7 @@ type AssignmentNode implements Node {
assignment: String!
solution: String
deleted: Boolean!
owner: UserNode
owner: PrivateUserNode
module: ModuleNode!
userCreated: Boolean!
taskbaseId: String
@ -203,7 +203,7 @@ enum BasicKnowledgeType {
}
type ChapterBookmarkNode implements Node {
user: UserNode!
user: PrivateUserNode!
note: NoteNode
id: ID!
chapter: ChapterNode!
@ -246,7 +246,7 @@ type ChapterNodeEdge {
}
type ClassMemberNode {
user: UserNode
user: PublicUserNode
active: Boolean
firstName: String
lastName: String
@ -256,7 +256,7 @@ type ClassMemberNode {
type ContentBlockBookmarkNode implements Node {
id: ID!
user: UserNode!
user: PrivateUserNode!
note: NoteNode
uuid: UUID
contentBlock: ContentBlockNode!
@ -296,6 +296,7 @@ type ContentBlockNode implements Node & ContentBlockInterface {
id: ID!
mine: Boolean
bookmarks: [ContentBlockBookmarkNode]
originalCreator: PublicUserNode
}
type ContentBlockNodeConnection {
@ -450,8 +451,8 @@ type CustomQuery {
rooms(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, appearance: String): RoomNodeConnection
allRoomEntries(offset: Int, before: String, after: String, first: Int, last: Int, slug: String): RoomEntryNodeConnection
moduleRoom(slug: String, classId: ID): RoomNode
me: UserNode
allUsers(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): UserNodeConnection
me: PrivateUserNode
allUsers(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): PrivateUserNodeConnection
myActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, slug_Icontains: String, slug_In: [String], title: String, title_Icontains: String, title_In: [String]): ModuleNodeConnection
myInstrumentActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, type: String): InstrumentNodeConnection
_debug: DjangoDebug
@ -564,7 +565,7 @@ enum InputTypes {
}
type InstrumentBookmarkNode implements Node {
user: UserNode!
user: PrivateUserNode!
note: NoteNode
id: ID!
uuid: UUID
@ -624,7 +625,7 @@ type Logout {
}
type ModuleBookmarkNode {
user: UserNode!
user: PrivateUserNode!
note: NoteNode
id: ID!
module: ModuleNode!
@ -735,7 +736,7 @@ type ObjectiveNode implements Node {
id: ID!
text: String!
group: ObjectiveGroupNode!
owner: UserNode
owner: PrivateUserNode
hiddenFor: [SchoolClassNode]
visibleFor: [SchoolClassNode]
order: Int
@ -767,6 +768,37 @@ input PasswordUpdateInput {
newPassword: String
}
type PrivateUserNode implements Node {
firstName: String!
lastName: String!
avatarUrl: String!
username: String!
lastModule: ModuleNode
lastTopic: TopicNode
email: String!
onboardingVisited: Boolean!
team: TeamNode
schoolClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection!
id: ID!
pk: Int
permissions: [String]
selectedClass: SchoolClassNode
expiryDate: String
isTeacher: Boolean
oldClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection
recentModules(offset: Int, before: String, after: String, first: Int, last: Int, recentModules: [ID], orderBy: String): ModuleNodeConnection
}
type PrivateUserNodeConnection {
pageInfo: PageInfo!
edges: [PrivateUserNodeEdge]!
}
type PrivateUserNodeEdge {
node: PrivateUserNode
cursor: String!
}
type ProjectEntryNode implements Node {
id: ID!
activity: String!
@ -794,7 +826,7 @@ type ProjectNode implements Node {
slug: String!
objectives: String!
appearance: String!
student: UserNode!
student: PrivateUserNode!
final: Boolean!
entries(offset: Int, before: String, after: String, first: Int, last: Int): ProjectEntryNodeConnection!
pk: Int
@ -811,13 +843,22 @@ type ProjectNodeEdge {
cursor: String!
}
type PublicUserNode implements Node {
firstName: String!
lastName: String!
avatarUrl: String!
id: ID!
isMe: Boolean
fullName: String!
}
type RoomEntryNode implements Node {
title: String!
description: String
slug: String!
id: ID!
room: RoomNode!
author: UserNode
author: PublicUserNode
contents: GenericStreamFieldType
pk: Int
}
@ -865,7 +906,7 @@ type SchoolClassNode implements Node {
name: String!
isDeleted: Boolean!
code: String
users(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): UserNodeConnection!
users(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): PrivateUserNodeConnection!
moduleSet(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, slug_Icontains: String, slug_In: [String], title: String, title_Icontains: String, title_In: [String]): ModuleNodeConnection!
hiddenChapterTitles(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ChapterNodeConnection!
hiddenChapterDescriptions(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ChapterNodeConnection!
@ -994,7 +1035,7 @@ type StudentSubmissionNode implements Node {
text: String!
document: String!
assignment: AssignmentNode!
student: UserNode!
student: PrivateUserNode!
final: Boolean!
submissionFeedback: SubmissionFeedbackNode
}
@ -1020,7 +1061,7 @@ type SubmissionFeedbackNode implements Node {
created: DateTime!
modified: DateTime!
text: String!
teacher: UserNode!
teacher: PrivateUserNode!
studentSubmission: StudentSubmissionNode!
final: Boolean!
id: ID!
@ -1063,8 +1104,8 @@ type TeamNode implements Node {
isDeleted: Boolean!
code: String
id: ID!
creator: UserNode
members: [UserNode]
creator: PrivateUserNode
members: [PublicUserNode]
pk: Int
}
@ -1421,35 +1462,3 @@ input UserGroupBlockVisibility {
schoolClassId: ID!
hidden: Boolean!
}
type UserNode implements Node {
username: String!
firstName: String!
lastName: String!
lastModule: ModuleNode
lastTopic: TopicNode
avatarUrl: String!
email: String!
onboardingVisited: Boolean!
team: TeamNode
schoolClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection!
id: ID!
pk: Int
permissions: [String]
selectedClass: SchoolClassNode
expiryDate: String
isTeacher: Boolean
oldClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection
recentModules(offset: Int, before: String, after: String, first: Int, last: Int, recentModules: [ID], orderBy: String): ModuleNodeConnection
isMe: Boolean
}
type UserNodeConnection {
pageInfo: PageInfo!
edges: [UserNodeEdge]!
}
type UserNodeEdge {
node: UserNode
cursor: String!
}