diff --git a/client/cypress/integration/frontend/portfolio/new-project.spec.js b/client/cypress/integration/frontend/portfolio/new-project.spec.js index 86c43062..2c7346af 100644 --- a/client/cypress/integration/frontend/portfolio/new-project.spec.js +++ b/client/cypress/integration/frontend/portfolio/new-project.spec.js @@ -1,35 +1,35 @@ +import {getMinimalMe} from '../../../support/helpers'; + describe('New project', () => { + const MeQuery = getMinimalMe({isTeacher: false}); + const schoolClass = MeQuery.me.selectedClass; + const operations = { ProjectsQuery: { - projects: { - edges: [ - { - node: { - id: 'UHJvamVjdE5vZGU6NjY=', - title: 'Some random title', - appearance: 'blue', - description: 'This description rocks', - slug: 'some-random-title', - objectives: 'Git gud', - final: false, - student: { - firstName: 'Rachel', - lastName: 'Green', - id: 'VXNlck5vZGU6NQ==', - avatarUrl: '', - }, - entriesCount: 0, - }, + projects: [ + { + id: 'UHJvamVjdE5vZGU6NjY=', + title: 'Some random title', + appearance: 'blue', + description: 'This description rocks', + slug: 'some-random-title', + objectives: 'Git gud', + final: false, + schoolClass, + student: { + firstName: 'Rachel', + lastName: 'Green', + id: 'VXNlck5vZGU6NQ==', + avatarUrl: '', }, - ], - }, - }, - MeQuery: { - me: {}, + entriesCount: 0, + }, + ], }, + MeQuery, AddProject: variables => ({ addProject: { - project: Object.assign({}, variables.input.project), + project: Object.assign({}, variables.input.project, {schoolClass}), errors: null, __typename: 'AddProjectPayload', }, diff --git a/client/cypress/integration/frontend/portfolio/project-entry.spec.js b/client/cypress/integration/frontend/portfolio/project-entry.spec.js index a7ca7a85..98657fee 100644 --- a/client/cypress/integration/frontend/portfolio/project-entry.spec.js +++ b/client/cypress/integration/frontend/portfolio/project-entry.spec.js @@ -7,30 +7,26 @@ describe('Project Entry', () => { }, }, ProjectsQuery: { - projects: { - edges: [{ - node: { - id: 'UHJvamVjdE5vZGU6MzM=', - title: 'Groot', - appearance: 'red', - 'description': 'I am Groot', - 'slug': 'groot', - 'objectives': 'Be Groot\nBe awesome', - 'final': false, - 'student': { - 'firstName': 'Rachel', - 'lastName': 'Green', - 'id': 'VXNlck5vZGU6NQ==', - 'avatarUrl': '', - '__typename': 'UserNode', - }, - 'entriesCount': 2, - '__typename': 'ProjectNode', + projects: [ + { + id: 'UHJvamVjdE5vZGU6MzM=', + title: 'Groot', + appearance: 'red', + 'description': 'I am Groot', + 'slug': 'groot', + 'objectives': 'Be Groot\nBe awesome', + 'final': false, + 'student': { + 'firstName': 'Rachel', + 'lastName': 'Green', + 'id': 'VXNlck5vZGU6NQ==', + 'avatarUrl': '', + '__typename': 'UserNode', }, - '__typename': 'ProjectNodeEdge', - }], - '__typename': 'ProjectNodeConnection', - }, + 'entriesCount': 2, + '__typename': 'ProjectNode', + }, + ], }, ProjectQuery: { 'project': { @@ -85,8 +81,7 @@ describe('Project Entry', () => { }), DeleteProjectEntry: { deleteProjectEntry: { - success: true, - __typename: 'DeleteProjectEntryPayload', + success: true }, }, }; diff --git a/client/src/components/content-forms/TextForm.vue b/client/src/components/content-forms/TextForm.vue index 16856932..25992aec 100644 --- a/client/src/components/content-forms/TextForm.vue +++ b/client/src/components/content-forms/TextForm.vue @@ -11,7 +11,15 @@