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 {getModules, getMe} from '../../support/helpers';
import mocks from '../../fixtures/mocks'; import mocks from '../../fixtures/mocks';

View File

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

View File

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

View File

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

View File

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