Add prettier to project, format cypress folder
This commit is contained in:
parent
e4dded714c
commit
647e684469
|
|
@ -0,0 +1 @@
|
|||
dist
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
module.exports = {
|
||||
'extends': [
|
||||
'plugin:cypress/recommended',
|
||||
],
|
||||
extends: ['plugin:cypress/recommended'],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,19 +42,25 @@ describe('The Login Page', () => {
|
|||
cy.viewport('macbook-15');
|
||||
cy.apolloLogin(user, pw);
|
||||
cy.visit('/me/my-class');
|
||||
cy.get('[data-cy=header-user-widget]').should('exist').within(() => {
|
||||
cy.get('[data-cy=header-user-widget]')
|
||||
.should('exist')
|
||||
.within(() => {
|
||||
cy.get('[data-cy=user-widget-avatar]').should('exist').click();
|
||||
});
|
||||
|
||||
cy.get('[data-cy=logout]').click();
|
||||
|
||||
cy.get('[data-cy=oauth-login]').should('exist').within(() => {
|
||||
cy.get('[data-cy=oauth-login]')
|
||||
.should('exist')
|
||||
.within(() => {
|
||||
cy.visit('/beta-login');
|
||||
});
|
||||
|
||||
cy.login(user, pw);
|
||||
|
||||
cy.get('[data-cy=header-user-widget]').should('exist').within(() => {
|
||||
cy.get('[data-cy=header-user-widget]')
|
||||
.should('exist')
|
||||
.within(() => {
|
||||
cy.get('[data-cy=user-widget-avatar]').should('exist').click();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {assertStartPage} from '../../../support/helpers';
|
|||
|
||||
const schema = require('../../../fixtures/schema.json');
|
||||
|
||||
const redeemCoupon = coupon => {
|
||||
const redeemCoupon = (coupon) => {
|
||||
if (coupon !== '') {
|
||||
cy.get('[data-cy="coupon-input"]').type(coupon);
|
||||
}
|
||||
|
|
@ -22,10 +22,10 @@ describe('Email Verification', () => {
|
|||
operations: {
|
||||
Coupon: {
|
||||
coupon: {
|
||||
success: true
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
cy.apolloLogin('rachel.green', 'test');
|
||||
|
||||
|
|
@ -48,8 +48,8 @@ describe('Email Verification', () => {
|
|||
cy.mockGraphql({
|
||||
schema: schema,
|
||||
operations: {
|
||||
Coupon: new GraphQLError('invalid_coupon')
|
||||
}
|
||||
Coupon: new GraphQLError('invalid_coupon'),
|
||||
},
|
||||
});
|
||||
cy.apolloLogin('rachel.green', 'test');
|
||||
|
||||
|
|
@ -63,13 +63,15 @@ describe('Email Verification', () => {
|
|||
cy.mockGraphql({
|
||||
schema: schema,
|
||||
operations: {
|
||||
Coupon: new GraphQLError('unknown_error')
|
||||
}
|
||||
Coupon: new GraphQLError('unknown_error'),
|
||||
},
|
||||
});
|
||||
cy.apolloLogin('rachel.green', 'test');
|
||||
|
||||
cy.visit('/license-activation');
|
||||
redeemCoupon('12345asfd');
|
||||
cy.get('[data-cy="coupon-remote-errors"]').contains('Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.');
|
||||
cy.get('[data-cy="coupon-remote-errors"]').contains(
|
||||
'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,14 +3,13 @@ import minimalModule from '../../fixtures/module.minimal';
|
|||
|
||||
const { me: minimalMe } = getMinimalMe({});
|
||||
|
||||
|
||||
describe('Bookmarks', () => {
|
||||
beforeEach(() => {
|
||||
cy.setup();
|
||||
cy.mockGraphqlOps({
|
||||
operations: {
|
||||
MeQuery: {
|
||||
me: minimalMe
|
||||
me: minimalMe,
|
||||
},
|
||||
ModuleDetailsQuery: {
|
||||
module: {
|
||||
|
|
@ -25,16 +24,16 @@ describe('Bookmarks', () => {
|
|||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: 'Das folgende Interview'
|
||||
text: 'Das folgende Interview',
|
||||
},
|
||||
id: 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
id: "df8212ee-3e82-49fa-977e-c4b60789163e"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
InstrumentQuery: {
|
||||
instrument: {
|
||||
|
|
@ -42,45 +41,45 @@ describe('Bookmarks', () => {
|
|||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: 'Hallo Sam'
|
||||
text: 'Hallo Sam',
|
||||
},
|
||||
id: 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
},
|
||||
],
|
||||
},
|
||||
id: "df8212ee-3e82-49fa-977e-c4b60789163e"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
UpdateLastModule: {},
|
||||
UpdateContentBookmark: {
|
||||
updateContentBookmark: {
|
||||
success: true
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
UpdateModuleBookmark: {
|
||||
updateModuleBookmark: {
|
||||
success: true
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
UpdateInstrumentBookmark: {
|
||||
updateModuleBookmark: {
|
||||
success: true
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
UpdateChapterBookmark: {
|
||||
updateChapterBookmark: {
|
||||
success: true
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
AddNote: ({ input: { note } }) => ({
|
||||
addNote: {
|
||||
note
|
||||
}
|
||||
note,
|
||||
},
|
||||
}),
|
||||
UpdateNote: ({ input: { note } }) => ({
|
||||
updateNote: {
|
||||
note
|
||||
}
|
||||
})
|
||||
}
|
||||
note,
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -109,7 +108,6 @@ describe('Bookmarks', () => {
|
|||
});
|
||||
|
||||
cy.get('[data-cy=modal-save-button]').click();
|
||||
|
||||
});
|
||||
|
||||
it('should bookmark module', () => {
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ describe('Instruments Page', () => {
|
|||
instrument: {
|
||||
title: 'A Guitar',
|
||||
intro: 'Money for Nothing',
|
||||
contents: ''
|
||||
contents: '',
|
||||
// id: ID!
|
||||
// bookmarks: [InstrumentBookmarkNode]
|
||||
// type: InstrumentTypeNode
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ describe('Instruments Page', () => {
|
|||
beforeEach(() => {
|
||||
cy.setup();
|
||||
|
||||
|
||||
const languageCategory = {
|
||||
name: LANGUAGE_COMMUNICATION_VALUE,
|
||||
id: LANGUAGE_COMMUNICATION,
|
||||
|
|
@ -30,21 +29,21 @@ describe('Instruments Page', () => {
|
|||
name: 'Analyse',
|
||||
category: languageCategory,
|
||||
type: ANALYSE,
|
||||
id: ANALYSE
|
||||
id: ANALYSE,
|
||||
};
|
||||
|
||||
const argumentation = {
|
||||
name: 'Argumentation',
|
||||
category: languageCategory,
|
||||
type: ARGUMENTATION,
|
||||
id: ARGUMENTATION
|
||||
id: ARGUMENTATION,
|
||||
};
|
||||
|
||||
const ethik = {
|
||||
name: 'Ethik',
|
||||
category: societyCategory,
|
||||
type: ETHIK,
|
||||
id: ETHIK
|
||||
id: ETHIK,
|
||||
};
|
||||
|
||||
cy.mockGraphqlOps({
|
||||
|
|
@ -133,7 +132,9 @@ describe('Instruments Page', () => {
|
|||
|
||||
it('shows the correct instrument label', () => {
|
||||
cy.visit('instruments/');
|
||||
cy.getByDataCy('instrument').first().within(() => {
|
||||
cy.getByDataCy('instrument')
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.getByDataCy('instrument-subheader').should('contain', 'Instrumente - Sprache & Kommunikation');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,34 +26,35 @@ describe('Instruments on Module page', () => {
|
|||
title: 'Some Chapter',
|
||||
contentBlocks: [
|
||||
{
|
||||
'type': 'instrument',
|
||||
type: 'instrument',
|
||||
instrumentCategory: {
|
||||
id: 'category-id',
|
||||
name: 'Sprache & Kommunikation'
|
||||
name: 'Sprache & Kommunikation',
|
||||
},
|
||||
'title': 'Das Interview',
|
||||
'contents': [
|
||||
title: 'Das Interview',
|
||||
contents: [
|
||||
{
|
||||
'type': 'basic_knowledge',
|
||||
'value': {
|
||||
'description': '<p>Ein Interview dient dazu, durch Befragung Informationen zu ermitteln. Bei journalistischen Interviews werden oft Expertinnen und Experten befragt, aber auch Personen.</p>',
|
||||
type: 'basic_knowledge',
|
||||
value: {
|
||||
description:
|
||||
'<p>Ein Interview dient dazu, durch Befragung Informationen zu ermitteln. Bei journalistischen Interviews werden oft Expertinnen und Experten befragt, aber auch Personen.</p>',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
'type': 'normal',
|
||||
'title': 'Normaler Block',
|
||||
type: 'normal',
|
||||
title: 'Normaler Block',
|
||||
instrumentCategory: null,
|
||||
'contents': [
|
||||
contents: [
|
||||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: 'Some text, not an instrument'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
text: 'Some text, not an instrument',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
@ -64,10 +65,14 @@ describe('Instruments on Module page', () => {
|
|||
});
|
||||
it('shows the correct instrument label', () => {
|
||||
cy.visit('module/module-with-instrument');
|
||||
cy.getByDataCy('content-block').first().within(() => {
|
||||
cy.getByDataCy('content-block')
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.getByDataCy('instrument-label').should('contain', 'Instrumente - Sprache & Kommunikation');
|
||||
});
|
||||
cy.getByDataCy('content-block').eq(1).within(() => {
|
||||
cy.getByDataCy('content-block')
|
||||
.eq(1)
|
||||
.within(() => {
|
||||
cy.getByDataCy('instrument-label').should('not.exist');
|
||||
});
|
||||
// also check that other content blocks don't have the label
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@ describe('Apply module visibility', () => {
|
|||
const schoolClasses = [
|
||||
{
|
||||
name: 'FLID2018a',
|
||||
id: btoa('SchoolClassNode:1')
|
||||
id: btoa('SchoolClassNode:1'),
|
||||
},
|
||||
{
|
||||
name: 'Andere Klasse',
|
||||
id: btoa('SchoolClassNode:2')
|
||||
id: btoa('SchoolClassNode:2'),
|
||||
},
|
||||
];
|
||||
|
||||
const { me: minimalMe } = getMinimalMe({});
|
||||
const me = {
|
||||
...minimalMe,
|
||||
schoolClasses
|
||||
schoolClasses,
|
||||
};
|
||||
// name: '[\'FLID2018a\', \'Andere Klasse\']'
|
||||
const operations = {
|
||||
MeQuery: {
|
||||
me
|
||||
me,
|
||||
},
|
||||
ModulesQuery: getModules,
|
||||
UpdateSettings: {
|
||||
|
|
@ -43,9 +43,9 @@ describe('Apply module visibility', () => {
|
|||
},
|
||||
ModuleDetailsQuery: {
|
||||
module: {
|
||||
id: 'some-module-id'
|
||||
}
|
||||
}
|
||||
id: 'some-module-id',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
@ -54,7 +54,7 @@ describe('Apply module visibility', () => {
|
|||
|
||||
it('clicks through the UI', () => {
|
||||
cy.mockGraphqlOps({
|
||||
operations
|
||||
operations,
|
||||
});
|
||||
|
||||
// go to module
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ describe('Content Blocks', () => {
|
|||
title: 'Hello world',
|
||||
slug,
|
||||
solutionsEnabled: false,
|
||||
chapters: [{
|
||||
chapters: [
|
||||
{
|
||||
contentBlocks: [
|
||||
{
|
||||
title: 'A content block',
|
||||
|
|
@ -35,7 +36,8 @@ describe('Content Blocks', () => {
|
|||
],
|
||||
},
|
||||
],
|
||||
}],
|
||||
},
|
||||
],
|
||||
};
|
||||
const operations = {
|
||||
ModuleDetailsQuery: {
|
||||
|
|
@ -56,7 +58,7 @@ describe('Content Blocks', () => {
|
|||
UpdateAssignmentWithSuccess: {
|
||||
updateAssignment: {
|
||||
successful: true,
|
||||
updatedAssignment: assignment
|
||||
updatedAssignment: assignment,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,6 +63,5 @@ describe('Create Content Block', () => {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
// todo: another test
|
||||
// edit existing content block
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ const modules = {
|
|||
|
||||
const slugs = {
|
||||
'lohn-und-budget': getId(1),
|
||||
'geld': getId(2),
|
||||
'lerntipps': getId(3),
|
||||
'random': getId(4),
|
||||
geld: getId(2),
|
||||
lerntipps: getId(3),
|
||||
random: getId(4),
|
||||
};
|
||||
|
||||
const getModuleBySlug = (slug) => {
|
||||
|
|
@ -58,7 +58,7 @@ const getModuleBySlug = (slug) => {
|
|||
return modules[id];
|
||||
};
|
||||
|
||||
const moduleNodes = Object.values(modules).map(module => ({
|
||||
const moduleNodes = Object.values(modules).map((module) => ({
|
||||
node: module,
|
||||
}));
|
||||
console.log(moduleNodes);
|
||||
|
|
@ -73,7 +73,7 @@ const getTopic = () => {
|
|||
modules: {
|
||||
edges: moduleNodes,
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -116,15 +116,15 @@ describe('Current Module', () => {
|
|||
AssignmentsQuery: {
|
||||
assignments: [],
|
||||
},
|
||||
ModuleDetailsQuery: variables => {
|
||||
ModuleDetailsQuery: (variables) => {
|
||||
console.log('calling ModuleDetailsQuery', getModuleBySlug(variables.slug));
|
||||
return {
|
||||
module: getModuleBySlug(variables.slug)
|
||||
module: getModuleBySlug(variables.slug),
|
||||
};
|
||||
},
|
||||
TopicsQuery: {
|
||||
topics: {
|
||||
edges: topics.map(topic => ({node: topic})),
|
||||
edges: topics.map((topic) => ({ node: topic })),
|
||||
},
|
||||
},
|
||||
Topic: getTopic(),
|
||||
|
|
@ -165,7 +165,9 @@ describe('Current Module', () => {
|
|||
|
||||
// module list exists, but does not have anything in it
|
||||
checkHome(0, true);
|
||||
cy.get('[data-cy=no-modules-yet]').should('exist').should('contain', 'Sie haben sich noch kein Modul angeschaut. Legen Sie jetzt los!');
|
||||
cy.get('[data-cy=no-modules-yet]')
|
||||
.should('exist')
|
||||
.should('contain', 'Sie haben sich noch kein Modul angeschaut. Legen Sie jetzt los!');
|
||||
|
||||
goToModule('Geld und Kauf', 'Modul 2');
|
||||
cy.get('[data-cy=module-title]').should('contain', 'Geld');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import module from '../../../fixtures/module.minimal';
|
||||
import { getMinimalMe } from '../../../support/helpers';
|
||||
|
||||
const chapters = [{
|
||||
const chapters = [
|
||||
{
|
||||
title: 'ABC',
|
||||
description: 'DEF',
|
||||
contentBlocks: [
|
||||
|
|
@ -13,13 +14,14 @@ const chapters = [{
|
|||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: 'Hello World'
|
||||
}
|
||||
}
|
||||
text: 'Hello World',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}];
|
||||
},
|
||||
];
|
||||
|
||||
const operations = {
|
||||
MeQuery: getMinimalMe({ isTeacher: true }),
|
||||
|
|
@ -31,12 +33,12 @@ const operations = {
|
|||
ModuleEditModeQuery: {
|
||||
module: {
|
||||
slug: 'some-module',
|
||||
}
|
||||
},
|
||||
},
|
||||
DeleteContentBlock: {
|
||||
success: true,
|
||||
},
|
||||
UpdateLastModule: {}
|
||||
UpdateLastModule: {},
|
||||
};
|
||||
|
||||
describe('Custom Content Block', () => {
|
||||
|
|
|
|||
|
|
@ -11,14 +11,13 @@ describe('Duplicate Content Block', () => {
|
|||
MeQuery: getMinimalMe({ isTeacher: true }),
|
||||
UpdateLastModule: {},
|
||||
ModuleEditModeQuery: {
|
||||
module: {
|
||||
}
|
||||
module: {},
|
||||
},
|
||||
AssignmentQuery: {
|
||||
assignment: {
|
||||
title: 'Ein Assignment',
|
||||
assignment: 'Eine Beschreibung'
|
||||
}
|
||||
assignment: 'Eine Beschreibung',
|
||||
},
|
||||
},
|
||||
ModuleDetailsQuery: {
|
||||
module: {
|
||||
|
|
@ -32,28 +31,27 @@ describe('Duplicate Content Block', () => {
|
|||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: '<p>Asdf</p>'
|
||||
}
|
||||
text: '<p>Asdf</p>',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'assignment',
|
||||
value: {
|
||||
title: 'Ein Auftrag',
|
||||
assignment: 'Eine Beschreibung',
|
||||
id: 'abcd'
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
id: 'abcd',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
cy.mockGraphqlOps({
|
||||
operations
|
||||
operations,
|
||||
});
|
||||
cy.visit('/module/some-module');
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ const mockDeleteSnapshot = (success) => {
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -80,7 +79,6 @@ const mockUpdateSnapshot = (title) => {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// wait for the specified amount of requests in the test, so they don't spill over to the next test
|
||||
|
|
@ -90,9 +88,8 @@ const waitForNRequests = (n) => {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
describe('Snapshot', () => {
|
||||
const operations = isTeacher => ({
|
||||
const operations = (isTeacher) => ({
|
||||
operations: {
|
||||
UpdateSnapshot: {
|
||||
updateSnapshot: {
|
||||
|
|
@ -130,7 +127,6 @@ describe('Snapshot', () => {
|
|||
};
|
||||
}
|
||||
return result;
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -146,7 +142,7 @@ describe('Snapshot', () => {
|
|||
created: '2022-01-01',
|
||||
creator: 'me',
|
||||
shared: false,
|
||||
mine: true
|
||||
mine: true,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
|
@ -221,14 +217,18 @@ describe('Snapshot', () => {
|
|||
it('Creates Snapshot', () => {
|
||||
cy.mockGraphqlOps(operations(true));
|
||||
cy.visit('module/miteinander-reden/snapshots');
|
||||
cy.getByDataCy('snapshot-list').should('exist').within(() => {
|
||||
cy.getByDataCy('snapshot-list')
|
||||
.should('exist')
|
||||
.within(() => {
|
||||
cy.get('.snapshots__snapshot').should('have.length', 1);
|
||||
});
|
||||
cy.getByDataCy('back-link').click();
|
||||
cy.getByDataCy('module-snapshots-button').click();
|
||||
cy.getByDataCy('create-snapshot-button').click();
|
||||
cy.getByDataCy('show-all-snapshots-button').click();
|
||||
cy.getByDataCy('snapshot-list').should('exist').within(() => {
|
||||
cy.getByDataCy('snapshot-list')
|
||||
.should('exist')
|
||||
.within(() => {
|
||||
cy.get('.snapshots__snapshot').should('have.length', 2);
|
||||
});
|
||||
waitForNRequests(7);
|
||||
|
|
@ -289,6 +289,5 @@ describe('Snapshot', () => {
|
|||
waitForNRequests(5);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
});
|
||||
afterEach(() => {});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,18 +3,18 @@ import mocks from '../../../fixtures/mocks';
|
|||
|
||||
const modules = {
|
||||
'lohn-und-budget': {
|
||||
'objectiveGroups': {
|
||||
'edges': [
|
||||
objectiveGroups: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'title': 'LANGUAGE_COMMUNICATION',
|
||||
'objectives': {
|
||||
'edges': [
|
||||
node: {
|
||||
title: 'LANGUAGE_COMMUNICATION',
|
||||
objectives: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'text': 'i-am-an-objective',
|
||||
'hiddenFor': {
|
||||
'edges': [],
|
||||
node: {
|
||||
text: 'i-am-an-objective',
|
||||
hiddenFor: {
|
||||
edges: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -69,7 +69,7 @@ const operations = {
|
|||
describe('Objective Visibility', () => {
|
||||
beforeEach(() => {
|
||||
cy.server();
|
||||
cy.task('getSchema').then(schema => {
|
||||
cy.task('getSchema').then((schema) => {
|
||||
cy.mockGraphql({
|
||||
schema,
|
||||
// endpoint: '/api/graphql'
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ describe('New project', () => {
|
|||
],
|
||||
},
|
||||
MeQuery,
|
||||
AddProject: variables => ({
|
||||
AddProject: (variables) => ({
|
||||
addProject: {
|
||||
project: Object.assign({}, variables.input.project, { schoolClass }),
|
||||
errors: null,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ describe('Project Page', () => {
|
|||
success: true,
|
||||
},
|
||||
},
|
||||
AddProjectEntry: variables => {
|
||||
AddProjectEntry: (variables) => {
|
||||
const projectEntry = Object.assign({}, variables.input.projectEntry, {
|
||||
created: createdLater,
|
||||
});
|
||||
|
|
@ -81,7 +81,7 @@ describe('Project Page', () => {
|
|||
},
|
||||
};
|
||||
},
|
||||
UpdateProjectEntry: variables => ({
|
||||
UpdateProjectEntry: (variables) => ({
|
||||
updateProjectEntry: {
|
||||
projectEntry: variables.input.projectEntry,
|
||||
errors: null,
|
||||
|
|
@ -116,7 +116,9 @@ describe('Project Page', () => {
|
|||
|
||||
it('has the correct layout', () => {
|
||||
cy.visit('/portfolio/groot');
|
||||
cy.getByDataCy('project-entry').eq(0).within(() => {
|
||||
cy.getByDataCy('project-entry')
|
||||
.eq(0)
|
||||
.within(() => {
|
||||
cy.getByDataCy('project-entry-date').should('contain', '1. Juni 2021');
|
||||
});
|
||||
});
|
||||
|
|
@ -255,5 +257,4 @@ describe('Project Page', () => {
|
|||
cy.getByDataCy('project-actions').should('not.be.visible');
|
||||
});
|
||||
});
|
||||
})
|
||||
;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ describe('Projects page', () => {
|
|||
entriesCount: 0,
|
||||
entries: {
|
||||
nodes: [],
|
||||
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
@ -82,8 +81,10 @@ describe('Projects page', () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
AddProject: variables => {
|
||||
const {input: {project}} = variables;
|
||||
AddProject: (variables) => {
|
||||
const {
|
||||
input: { project },
|
||||
} = variables;
|
||||
return {
|
||||
addProject: {
|
||||
errors: null,
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ const getOperations = ({readOnly, classReadOnly = false}) => ({
|
|||
readOnly,
|
||||
selectedClass: {
|
||||
id: 'selectedClassId',
|
||||
readOnly: classReadOnly
|
||||
}
|
||||
readOnly: classReadOnly,
|
||||
},
|
||||
},
|
||||
},
|
||||
StudentSubmissions: {
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ const getOperations = ({final, readOnly, classReadOnly = false}) => ({
|
|||
readOnly,
|
||||
selectedClass: {
|
||||
id: 'selectedClassId',
|
||||
readOnly: classReadOnly
|
||||
}
|
||||
readOnly: classReadOnly,
|
||||
},
|
||||
},
|
||||
},
|
||||
ModuleDetailsQuery: {
|
||||
|
|
@ -53,7 +53,7 @@ const getOperations = ({final, readOnly, classReadOnly = false}) => ({
|
|||
text: myText,
|
||||
final,
|
||||
document: '',
|
||||
submissionFeedback: null
|
||||
submissionFeedback: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -66,7 +66,7 @@ describe('Assignments read-only - Student', () => {
|
|||
|
||||
it('can edit and turn in', () => {
|
||||
cy.mockGraphqlOps({
|
||||
operations: getOperations({final: false, readOnly: false})
|
||||
operations: getOperations({ final: false, readOnly: false }),
|
||||
});
|
||||
cy.visit('module/module-with-assignment');
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ describe('Assignments read-only - Student', () => {
|
|||
// todo: very flaky test, fix and re-enable
|
||||
it.skip('can not edit or turn in', () => {
|
||||
cy.mockGraphqlOps({
|
||||
operations: getOperations({final: false, readOnly: true})
|
||||
operations: getOperations({ final: false, readOnly: true }),
|
||||
});
|
||||
cy.visit('module/module-with-assignment');
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ describe('Assignments read-only - Student', () => {
|
|||
|
||||
it('can revoke turn in', () => {
|
||||
cy.mockGraphqlOps({
|
||||
operations: getOperations({final: true, readOnly: false})
|
||||
operations: getOperations({ final: true, readOnly: false }),
|
||||
});
|
||||
|
||||
cy.visit('module/module-with-assignment');
|
||||
|
|
@ -102,7 +102,7 @@ describe('Assignments read-only - Student', () => {
|
|||
|
||||
it('can not revoke turn in', () => {
|
||||
cy.mockGraphqlOps({
|
||||
operations: getOperations({final: true, readOnly: true})
|
||||
operations: getOperations({ final: true, readOnly: true }),
|
||||
});
|
||||
|
||||
cy.visit('module/module-with-assignment');
|
||||
|
|
@ -112,7 +112,7 @@ describe('Assignments read-only - Student', () => {
|
|||
|
||||
it('can not edit or turn in in inactive class', () => {
|
||||
cy.mockGraphqlOps({
|
||||
operations: getOperations({final: false, readOnly: false, classReadOnly: true})
|
||||
operations: getOperations({ final: false, readOnly: false, classReadOnly: true }),
|
||||
});
|
||||
cy.visit('module/module-with-assignment');
|
||||
|
||||
|
|
|
|||
|
|
@ -35,10 +35,7 @@ describe('Read Only Banner', () => {
|
|||
cy.getByDataCy('start-page-heading').should('exist');
|
||||
|
||||
cy.getByDataCy('read-only-banner').should('exist').should('contain', 'Lizenz');
|
||||
cy.getByDataCy('license-activation-link')
|
||||
.should('exist')
|
||||
.should('contain', 'Neuen Lizenzcode eingeben')
|
||||
.click();
|
||||
cy.getByDataCy('license-activation-link').should('exist').should('contain', 'Neuen Lizenzcode eingeben').click();
|
||||
cy.url().should('contain', 'license-activation');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const getOperations = (readOnly = false, classReadOnly = false) => {
|
|||
lastName: 'Schneider',
|
||||
isTeacher: true,
|
||||
isMe: true,
|
||||
active: true
|
||||
active: true,
|
||||
},
|
||||
{
|
||||
id: 'notMeId',
|
||||
|
|
@ -27,7 +27,7 @@ const getOperations = (readOnly = false, classReadOnly = false) => {
|
|||
lastName: 'Waalkes',
|
||||
isTeacher: false,
|
||||
isMe: false,
|
||||
active: true
|
||||
active: true,
|
||||
},
|
||||
{
|
||||
id: 'alsoNotMeId',
|
||||
|
|
@ -35,17 +35,17 @@ const getOperations = (readOnly = false, classReadOnly = false) => {
|
|||
lastName: 'Yanar',
|
||||
isTeacher: false,
|
||||
isMe: false,
|
||||
active: false
|
||||
}
|
||||
]
|
||||
}
|
||||
active: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
AddRemoveMember: {
|
||||
addRemoveMember: {
|
||||
success: true
|
||||
}
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const getOperations = ({readOnly, classReadOnly = false}) => ({
|
|||
...minimalModule,
|
||||
},
|
||||
},
|
||||
UpdateLastModule: {}
|
||||
UpdateLastModule: {},
|
||||
});
|
||||
|
||||
const moduleNavigationTest = ({ readOnly, classReadOnly = false, displayMenu }) => {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,8 @@ import {getMinimalMe} from '../../../support/helpers';
|
|||
const getOperations = ({ readOnly }) => ({
|
||||
MeQuery: getMinimalMe({ readOnly }),
|
||||
NewsTeasers: {
|
||||
newsTeasers: [
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
]
|
||||
}
|
||||
newsTeasers: [{}, {}, {}],
|
||||
},
|
||||
});
|
||||
|
||||
describe('Read Only News', () => {
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ const getOperations = ({readOnly = false, classReadOnly = false}) => ({
|
|||
id: btoa('PrivateUserNode:1'),
|
||||
},
|
||||
entriesCount: 1,
|
||||
entries: [
|
||||
{}
|
||||
]
|
||||
entries: [{}],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ describe('Room Team Management - Read only', () => {
|
|||
},
|
||||
},
|
||||
RoomsQuery: {
|
||||
rooms: [{
|
||||
rooms: [
|
||||
{
|
||||
id: '',
|
||||
slug: '',
|
||||
title: 'some room',
|
||||
|
|
@ -24,7 +25,8 @@ describe('Room Team Management - Read only', () => {
|
|||
id: SELECTED_CLASS_ID,
|
||||
name: 'bla',
|
||||
},
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ describe('School Class and Team Management - Read only', () => {
|
|||
beforeEach(() => {
|
||||
cy.fakeLogin('rachel.green', 'test');
|
||||
cy.server();
|
||||
cy.task('getSchema').then(schema => {
|
||||
cy.task('getSchema').then((schema) => {
|
||||
cy.mockGraphql({
|
||||
schema,
|
||||
mocks,
|
||||
|
|
|
|||
|
|
@ -7,17 +7,20 @@ describe('Article page', () => {
|
|||
id: 'room-entry-id',
|
||||
title: 'Some Room Entry, yay!',
|
||||
comments: [],
|
||||
contents: [{
|
||||
contents: [
|
||||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: 'Ein Text',
|
||||
},
|
||||
}, {
|
||||
},
|
||||
{
|
||||
type: 'subtitle',
|
||||
value: {
|
||||
text: 'Ein Untertitel'
|
||||
}
|
||||
}],
|
||||
text: 'Ein Untertitel',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const operations = {
|
||||
|
|
@ -67,7 +70,9 @@ describe('Article page', () => {
|
|||
cy.getByDataCy('comment-textarea').type(commentText);
|
||||
cy.getByDataCy('emoji-button').should('have.length', 9).first().click();
|
||||
cy.getByDataCy('submit-comment').should('contain', 'Kommentar teilen').click();
|
||||
cy.getByDataCy('comment').first().should('contain', commentText + emoji);
|
||||
cy.getByDataCy('comment')
|
||||
.first()
|
||||
.should('contain', commentText + emoji);
|
||||
});
|
||||
|
||||
it('does not show input field on mobile', () => {
|
||||
|
|
|
|||
|
|
@ -256,9 +256,11 @@ describe('The Room Page (student)', () => {
|
|||
schoolClass: selectedClass,
|
||||
restricted: false,
|
||||
roomEntries: {
|
||||
edges: [{
|
||||
edges: [
|
||||
{
|
||||
node: roomEntry,
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -367,7 +369,6 @@ describe('The Room Page (student)', () => {
|
|||
cy.getByDataCy('delete-room-entry').should('not.exist');
|
||||
cy.getByDataCy('modal-save-button').click();
|
||||
cy.getByDataCy('room-entry').should('have.length', 0);
|
||||
|
||||
});
|
||||
|
||||
it('shows room entries with comment count', () => {
|
||||
|
|
@ -380,7 +381,9 @@ describe('The Room Page (student)', () => {
|
|||
});
|
||||
|
||||
cy.visit(`/room/${slug}`);
|
||||
cy.getByDataCy('room-entry').should('have.length', 1).within(() => {
|
||||
cy.getByDataCy('room-entry')
|
||||
.should('have.length', 1)
|
||||
.within(() => {
|
||||
cy.getByDataCy('entry-count').should('contain.text', '2');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,11 +5,13 @@ describe('The Rooms Page', () => {
|
|||
const getOperations = (isTeacher) => ({
|
||||
MeQuery: getMinimalMe({ isTeacher }),
|
||||
RoomsQuery: {
|
||||
rooms: [{
|
||||
rooms: [
|
||||
{
|
||||
schoolClass: {
|
||||
id: SELECTED_CLASS_ID_ENCODED,
|
||||
},
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -87,21 +89,23 @@ describe('The Rooms Page', () => {
|
|||
entryCount: 3,
|
||||
appearance: appearance,
|
||||
description: description,
|
||||
schoolClass: MeQuery.me.selectedClass
|
||||
schoolClass: MeQuery.me.selectedClass,
|
||||
};
|
||||
};
|
||||
let rooms = [
|
||||
getRoom('First Room', 'blue', 'Some description')
|
||||
];
|
||||
let rooms = [getRoom('First Room', 'blue', 'Some description')];
|
||||
|
||||
const operations = {
|
||||
MeQuery,
|
||||
RoomsQuery() {
|
||||
return {
|
||||
rooms
|
||||
rooms,
|
||||
};
|
||||
},
|
||||
AddRoom({input: {room: {title, appearance, description}}}) {
|
||||
AddRoom({
|
||||
input: {
|
||||
room: { title, appearance, description },
|
||||
},
|
||||
}) {
|
||||
const room = getRoom(title, appearance, description);
|
||||
rooms.push(room);
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ const operations = {
|
|||
final: false,
|
||||
document: '',
|
||||
submissionFeedback: {
|
||||
'id': 'U3VibWlzc2lvbkZlZWRiYWNrTm9kZTox',
|
||||
'text': '\ud83d\ude42\ud83d\ude10\ud83e\udd2c\ud83d\udc4d\ud83e\udd22\ud83e\udd22\ud83e\udd22\ud83e\udd22\ud83d\ude2e\ud83e\udd17',
|
||||
'teacher': {
|
||||
'firstName': 'Nico',
|
||||
'lastName': 'Zickgraf',
|
||||
'__typename': 'UserNode',
|
||||
id: 'U3VibWlzc2lvbkZlZWRiYWNrTm9kZTox',
|
||||
text: '\ud83d\ude42\ud83d\ude10\ud83e\udd2c\ud83d\udc4d\ud83e\udd22\ud83e\udd22\ud83e\udd22\ud83e\udd22\ud83d\ude2e\ud83e\udd17',
|
||||
teacher: {
|
||||
firstName: 'Nico',
|
||||
lastName: 'Zickgraf',
|
||||
__typename: 'UserNode',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -38,76 +38,76 @@ const operations = {
|
|||
...module,
|
||||
assignments: [
|
||||
{
|
||||
'id': 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
'title': 'Ein Auftragstitel',
|
||||
'assignment': 'Ein Auftrag',
|
||||
'solution': null,
|
||||
'submission': {
|
||||
'id': 'U3R1ZGVudFN1Ym1pc3Npb25Ob2RlOjE=',
|
||||
'text': userText,
|
||||
'final': false,
|
||||
'document': '',
|
||||
'submissionFeedback': {
|
||||
'id': 'U3VibWlzc2lvbkZlZWRiYWNrTm9kZTox',
|
||||
'text': '🙂😐🤬👍🤢🤢🤢🤢😮🤗',
|
||||
'teacher': {
|
||||
'firstName': 'Nico',
|
||||
'lastName': 'Zickgraf',
|
||||
'__typename': 'UserNode',
|
||||
id: 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
title: 'Ein Auftragstitel',
|
||||
assignment: 'Ein Auftrag',
|
||||
solution: null,
|
||||
submission: {
|
||||
id: 'U3R1ZGVudFN1Ym1pc3Npb25Ob2RlOjE=',
|
||||
text: userText,
|
||||
final: false,
|
||||
document: '',
|
||||
submissionFeedback: {
|
||||
id: 'U3VibWlzc2lvbkZlZWRiYWNrTm9kZTox',
|
||||
text: '🙂😐🤬👍🤢🤢🤢🤢😮🤗',
|
||||
teacher: {
|
||||
firstName: 'Nico',
|
||||
lastName: 'Zickgraf',
|
||||
__typename: 'UserNode',
|
||||
},
|
||||
'__typename': 'SubmissionFeedbackNode',
|
||||
__typename: 'SubmissionFeedbackNode',
|
||||
},
|
||||
'__typename': 'StudentSubmissionNode',
|
||||
__typename: 'StudentSubmissionNode',
|
||||
},
|
||||
'__typename': 'AssignmentNode',
|
||||
__typename: 'AssignmentNode',
|
||||
},
|
||||
],
|
||||
chapters: [
|
||||
{
|
||||
'id': 'Q2hhcHRlck5vZGU6MTg=',
|
||||
'title': '1.1 Lehrbeginn',
|
||||
'description': 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
'bookmark': {
|
||||
'note': {
|
||||
'id': 'Tm90ZU5vZGU6Mg==',
|
||||
'text': 'Chapter Chapter',
|
||||
'__typename': 'NoteNode',
|
||||
id: 'Q2hhcHRlck5vZGU6MTg=',
|
||||
title: '1.1 Lehrbeginn',
|
||||
description: 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
bookmark: {
|
||||
note: {
|
||||
id: 'Tm90ZU5vZGU6Mg==',
|
||||
text: 'Chapter Chapter',
|
||||
__typename: 'NoteNode',
|
||||
},
|
||||
'__typename': 'ChapterBookmarkNode',
|
||||
__typename: 'ChapterBookmarkNode',
|
||||
},
|
||||
contentBlocks: [
|
||||
{
|
||||
'id': 'Q29udGVudEJsb2NrTm9kZToxOQ==',
|
||||
'slug': 'assignment',
|
||||
'title': 'Assignment',
|
||||
'type': 'NORMAL',
|
||||
'contents': [
|
||||
id: 'Q29udGVudEJsb2NrTm9kZToxOQ==',
|
||||
slug: 'assignment',
|
||||
title: 'Assignment',
|
||||
type: 'NORMAL',
|
||||
contents: [
|
||||
{
|
||||
'type': 'assignment',
|
||||
'value': {
|
||||
'title': 'Ein Auftragstitel',
|
||||
'assignment': 'Ein Auftrag',
|
||||
'id': 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
type: 'assignment',
|
||||
value: {
|
||||
title: 'Ein Auftragstitel',
|
||||
assignment: 'Ein Auftrag',
|
||||
id: 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
},
|
||||
'id': 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
id: 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
},
|
||||
],
|
||||
'userCreated': false,
|
||||
'mine': false,
|
||||
'bookmarks': [
|
||||
userCreated: false,
|
||||
mine: false,
|
||||
bookmarks: [
|
||||
{
|
||||
'uuid': 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
'note': {
|
||||
'id': 'Tm90ZU5vZGU6Mw==',
|
||||
'text': 'Noch eine Notiz',
|
||||
'__typename': 'NoteNode',
|
||||
uuid: 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
note: {
|
||||
id: 'Tm90ZU5vZGU6Mw==',
|
||||
text: 'Noch eine Notiz',
|
||||
__typename: 'NoteNode',
|
||||
},
|
||||
'__typename': 'ContentBlockBookmarkNode',
|
||||
__typename: 'ContentBlockBookmarkNode',
|
||||
},
|
||||
],
|
||||
'hiddenFor': [],
|
||||
'visibleFor': [],
|
||||
'__typename': 'ContentBlockNode',
|
||||
hiddenFor: [],
|
||||
visibleFor: [],
|
||||
__typename: 'ContentBlockNode',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ describe('Survey', () => {
|
|||
permissions: [],
|
||||
},
|
||||
},
|
||||
ModuleQuery: variables => ({module}),
|
||||
ModuleQuery: (variables) => ({ module }),
|
||||
SurveyQuery: () => ({
|
||||
survey: {
|
||||
id: 'U3VydmV5Tm9kZTox',
|
||||
|
|
@ -29,9 +29,8 @@ describe('Survey', () => {
|
|||
answer,
|
||||
__typename: 'SurveyNode',
|
||||
},
|
||||
|
||||
}),
|
||||
UpdateAnswer: variables => {
|
||||
UpdateAnswer: (variables) => {
|
||||
answer = variables.input.answer;
|
||||
return {
|
||||
updateAnswer: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
describe('The Home Page', () => {
|
||||
it('successfully loads', () => {
|
||||
cy.visit('/')
|
||||
})
|
||||
})
|
||||
cy.visit('/');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ describe('Onboarding', () => {
|
|||
},
|
||||
};
|
||||
},
|
||||
NewsTeasers: {}
|
||||
NewsTeasers: {},
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -65,8 +65,8 @@ describe('Onboarding', () => {
|
|||
cy.mockGraphqlOps({
|
||||
operations: {
|
||||
MeQuery: {
|
||||
me: {}
|
||||
}
|
||||
me: {},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@ describe('School Class Management', () => {
|
|||
|
||||
cy.get('[data-cy=class-selection]').click();
|
||||
cy.get('[data-cy=class-selection-entry]').should('have.length', 2);
|
||||
})
|
||||
;
|
||||
});
|
||||
|
||||
it('should leave and re-join class', () => {
|
||||
cy.mockGraphqlOps({
|
||||
|
|
@ -204,10 +203,7 @@ describe('Teacher Class Management', () => {
|
|||
it('removes student, then leaves class, then rejoins', () => {
|
||||
const myId = btoa('PrivateUserNode:1');
|
||||
const memberId = btoa('GroupMemberNode:1');
|
||||
let classMembers = [
|
||||
{...teacher, id: myId, isMe: true, isTeacher: true},
|
||||
...members,
|
||||
];
|
||||
let classMembers = [{ ...teacher, id: myId, isMe: true, isTeacher: true }, ...members];
|
||||
let me = () => ({
|
||||
...teacher,
|
||||
id: memberId,
|
||||
|
|
@ -255,9 +251,7 @@ describe('Teacher Class Management', () => {
|
|||
const name = 'Hill Valley';
|
||||
let selectedClass = teacher.selectedClass;
|
||||
|
||||
const schoolClasses = [
|
||||
teacher.selectedClass,
|
||||
];
|
||||
const schoolClasses = [teacher.selectedClass];
|
||||
|
||||
const me = () => ({
|
||||
...teacher,
|
||||
|
|
@ -265,7 +259,6 @@ describe('Teacher Class Management', () => {
|
|||
schoolClasses,
|
||||
});
|
||||
|
||||
|
||||
cy.mockGraphqlOps({
|
||||
operations: {
|
||||
MeQuery: () => ({
|
||||
|
|
@ -290,14 +283,13 @@ describe('Teacher Class Management', () => {
|
|||
req.reply({
|
||||
data: {
|
||||
createSchoolClass: {
|
||||
result: schoolClass
|
||||
}
|
||||
}
|
||||
result: schoolClass,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
cy.visit('/me/my-class');
|
||||
|
||||
cy.get('h1').should('exist');
|
||||
|
|
@ -332,9 +324,7 @@ describe('Teacher Class Management', () => {
|
|||
let selectedClass = teacher.selectedClass;
|
||||
selectedClass.name = 'Some stupid class';
|
||||
|
||||
const schoolClasses = [
|
||||
teacher.selectedClass,
|
||||
];
|
||||
const schoolClasses = [teacher.selectedClass];
|
||||
|
||||
const me = () => ({
|
||||
...teacher,
|
||||
|
|
@ -365,10 +355,10 @@ describe('Teacher Class Management', () => {
|
|||
createSchoolClass: {
|
||||
result: {
|
||||
__typename: 'DuplicateName',
|
||||
reason: 'Dieser Name wird bereits verwendet.'
|
||||
}
|
||||
}
|
||||
}
|
||||
reason: 'Dieser Name wird bereits verwendet.',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -391,6 +381,5 @@ describe('Teacher Class Management', () => {
|
|||
cy.get('[data-cy=join-form-confirm]').click();
|
||||
|
||||
cy.getByDataCy('join-form-input-error').should('contain', 'Dieser Name wird bereits verwendet.');
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const mockCreateTeamCall = (name) => {
|
|||
} else {
|
||||
result = {
|
||||
__typename: 'DuplicateName',
|
||||
reason: 'Dieser Name wird bereits verwendet.'
|
||||
reason: 'Dieser Name wird bereits verwendet.',
|
||||
};
|
||||
}
|
||||
req.reply({
|
||||
|
|
@ -30,7 +30,6 @@ const mockCreateTeamCall = (name) => {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
describe('Team', () => {
|
||||
|
|
@ -63,7 +62,7 @@ describe('Team', () => {
|
|||
});
|
||||
|
||||
it('tries to create team but fails due to duplicate name', () => {
|
||||
const name = 'Gibt\'s schon';
|
||||
const name = "Gibt's schon";
|
||||
|
||||
mockCreateTeamCall(false);
|
||||
cy.visit('/me/team');
|
||||
|
|
|
|||
|
|
@ -78,8 +78,7 @@
|
|||
],
|
||||
"userCreated": false,
|
||||
"mine": false,
|
||||
"bookmarks": [
|
||||
],
|
||||
"bookmarks": [],
|
||||
"hiddenFor": {
|
||||
"edges": [],
|
||||
"__typename": "SchoolClassNodeConnection"
|
||||
|
|
@ -151,8 +150,7 @@
|
|||
],
|
||||
"userCreated": false,
|
||||
"mine": false,
|
||||
"bookmarks": [
|
||||
],
|
||||
"bookmarks": [],
|
||||
"hiddenFor": {
|
||||
"edges": [],
|
||||
"__typename": "SchoolClassNodeConnection"
|
||||
|
|
|
|||
|
|
@ -95,4 +95,3 @@
|
|||
"__typename": "TopicNode"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,13 @@
|
|||
"slug": "geld-und-kauf",
|
||||
"__typename": "TopicNode"
|
||||
},
|
||||
"schoolClasses": [{
|
||||
"schoolClasses": [
|
||||
{
|
||||
"id": "U2Nob29sQ2xhc3NOb2RlOjE=",
|
||||
"name": "FLID2018a",
|
||||
"__typename": "SchoolClassNode"
|
||||
}],
|
||||
}
|
||||
],
|
||||
"__typename": "UserNode",
|
||||
"onboardingVisited": true,
|
||||
"permissions": []
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const minimalMe = {
|
|||
readOnly: false,
|
||||
};
|
||||
|
||||
export const getMe = isTeacher => ({
|
||||
export const getMe = (isTeacher) => ({
|
||||
...minimalMe,
|
||||
isTeacher,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export default {
|
|||
id: getChapterId(),
|
||||
title: 'chapter-title',
|
||||
description: 'chapter-description',
|
||||
bookmark: null
|
||||
bookmark: null,
|
||||
}),
|
||||
ContentBlockNode: () => ({
|
||||
contents: [],
|
||||
|
|
@ -90,7 +90,7 @@ export default {
|
|||
assignments: [],
|
||||
objectiveGroups: [],
|
||||
id: getModuleId(),
|
||||
bookmark: null
|
||||
bookmark: null,
|
||||
}),
|
||||
TopicNode: () => ({
|
||||
modules: [],
|
||||
|
|
@ -113,6 +113,6 @@ export default {
|
|||
title: 'instrument-title',
|
||||
slug: 'instrument-slug',
|
||||
id: getInstrumentId(),
|
||||
bookmarks: null
|
||||
})
|
||||
bookmarks: null,
|
||||
}),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ export default {
|
|||
topic: {
|
||||
title: 'A Topic Mock Title',
|
||||
description: 'A Topic Mock Description',
|
||||
slug: 'a-topic-slug'
|
||||
slug: 'a-topic-slug',
|
||||
},
|
||||
slug: 'a-module-slug',
|
||||
solutionsEnabled: false,
|
||||
bookmark: null,
|
||||
__typename: 'ModuleNode'
|
||||
__typename: 'ModuleNode',
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
require("tsconfig-paths").register();
|
||||
require('tsconfig-paths').register();
|
||||
|
||||
const { readFileSync } = require('fs');
|
||||
const { resolve } = require('path');
|
||||
|
|
@ -21,10 +21,7 @@ module.exports = (on) => {
|
|||
// `config` is the resolved Cypress config
|
||||
on('task', {
|
||||
getSchema() {
|
||||
return readFileSync(
|
||||
resolve(__dirname, '../../../server/schema.graphql'),
|
||||
'utf8'
|
||||
);
|
||||
}
|
||||
return readFileSync(resolve(__dirname, '../../../server/schema.graphql'), 'utf8');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
//
|
||||
import {makeExecutableSchema} from "@graphql-tools/schema";
|
||||
import { makeExecutableSchema } from '@graphql-tools/schema';
|
||||
|
||||
declare global {
|
||||
namespace Cypress {
|
||||
|
|
@ -37,7 +37,7 @@ declare global {
|
|||
* @example
|
||||
* cy.apolloLogin('ross.geller', 'test')
|
||||
*/
|
||||
apolloLogin(username: string, password: string): Chainable<any>
|
||||
apolloLogin(username: string, password: string): Chainable<any>;
|
||||
|
||||
/**
|
||||
* Selects an element based on the `data-cy=xxx` attribute
|
||||
|
|
@ -45,19 +45,19 @@ declare global {
|
|||
* @example
|
||||
* cy.getByDataCy('my-new-button')
|
||||
*/
|
||||
getByDataCy(selector: string): Chainable<Element>
|
||||
getByDataCy(selector: string): Chainable<Element>;
|
||||
|
||||
selectClass(schoolClass: string): void
|
||||
selectClass(schoolClass: string): void;
|
||||
|
||||
login(username: string, password: string, visitLogin?: boolean): void
|
||||
login(username: string, password: string, visitLogin?: boolean): void;
|
||||
|
||||
fakeLogin(username: string, password: string): void
|
||||
fakeLogin(username: string, password: string): void;
|
||||
|
||||
isSubmissionReadOnly(myText: string): void
|
||||
isSubmissionReadOnly(myText: string): void;
|
||||
|
||||
openSidebar(): void
|
||||
openSidebar(): void;
|
||||
|
||||
setup(): void
|
||||
setup(): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -66,19 +66,20 @@ declare global {
|
|||
// todo: once above issue is fixed, go back to the original repo -> npm install cypress-graphql-mock
|
||||
// import 'cypress-graphql-mock';
|
||||
import mocks from '../fixtures/mocks';
|
||||
import {addMocksToSchema} from "@graphql-tools/mock";
|
||||
import {graphql, GraphQLError} from "graphql";
|
||||
import { addMocksToSchema } from '@graphql-tools/mock';
|
||||
import { graphql, GraphQLError } from 'graphql';
|
||||
|
||||
Cypress.Commands.add('apolloLogin', (username, password) => {
|
||||
const payload = {
|
||||
'operationName': 'BetaLogin',
|
||||
'variables': {
|
||||
'input': {
|
||||
'usernameInput': username,
|
||||
'passwordInput': password,
|
||||
operationName: 'BetaLogin',
|
||||
variables: {
|
||||
input: {
|
||||
usernameInput: username,
|
||||
passwordInput: password,
|
||||
},
|
||||
},
|
||||
'query': 'mutation BetaLogin($input: BetaLoginInput!) {\n betaLogin(input: $input) {\n success\n __typename\n }\n}\n',
|
||||
query:
|
||||
'mutation BetaLogin($input: BetaLoginInput!) {\n betaLogin(input: $input) {\n success\n __typename\n }\n}\n',
|
||||
};
|
||||
|
||||
cy.request({
|
||||
|
|
@ -104,7 +105,6 @@ Cypress.Commands.add('login', (username, password, visitLogin = false) => {
|
|||
cy.get('[data-cy=login-button]').click();
|
||||
});
|
||||
|
||||
|
||||
Cypress.Commands.add('getByDataCy', (selector: string) => {
|
||||
return cy.get(`[data-cy=${selector}]`);
|
||||
});
|
||||
|
|
@ -141,24 +141,24 @@ Cypress.Commands.add('setup', () => {
|
|||
const typenameResolver = {
|
||||
__resolveType(obj, context, info) {
|
||||
return obj.__typename;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Cypress.Commands.add('mockGraphql', (options?: any) => {
|
||||
cy.task('getSchema').then((schemaString: string) => {
|
||||
const resolverMap = {
|
||||
DeleteSnapshotResult: typenameResolver,
|
||||
UpdateSnapshotResult: typenameResolver
|
||||
UpdateSnapshotResult: typenameResolver,
|
||||
};
|
||||
const schema = makeExecutableSchema({
|
||||
typeDefs: schemaString,
|
||||
resolvers: resolverMap
|
||||
resolvers: resolverMap,
|
||||
});
|
||||
|
||||
const schemaWithMocks = addMocksToSchema({
|
||||
schema,
|
||||
mocks,
|
||||
preserveResolvers: true
|
||||
preserveResolvers: true,
|
||||
});
|
||||
|
||||
let currentOperations = options && options.operations ? options.operations : {};
|
||||
|
|
@ -177,16 +177,14 @@ Cypress.Commands.add('mockGraphql', (options?: any) => {
|
|||
// We will lose instanceof if we are not using specific babel plugin, or using pure TS to compile front-end
|
||||
rootValue instanceof GraphQLError ||
|
||||
rootValue.constructor === GraphQLError ||
|
||||
rootValue.constructor.name === "GraphQLError"
|
||||
rootValue.constructor.name === 'GraphQLError'
|
||||
) {
|
||||
return req.reply(
|
||||
{
|
||||
return req.reply({
|
||||
body: {
|
||||
data: {},
|
||||
errors: [rootValue]
|
||||
}
|
||||
}
|
||||
);
|
||||
errors: [rootValue],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
graphql({
|
||||
|
|
@ -194,26 +192,28 @@ Cypress.Commands.add('mockGraphql', (options?: any) => {
|
|||
source: query,
|
||||
variableValues: variables,
|
||||
operationName,
|
||||
rootValue
|
||||
}).then(result => {
|
||||
rootValue,
|
||||
}).then(
|
||||
(result) => {
|
||||
req.reply({
|
||||
...result,
|
||||
});
|
||||
}, e => {
|
||||
},
|
||||
(e) => {
|
||||
console.error(e);
|
||||
});
|
||||
}
|
||||
);
|
||||
}).as('graphqlRequest');
|
||||
|
||||
cy.wrap({
|
||||
setOperations: (options: any) => {
|
||||
currentOperations = {
|
||||
...currentOperations,
|
||||
...options.operations
|
||||
...options.operations,
|
||||
};
|
||||
}
|
||||
},
|
||||
}).as('mockGraphqlOps');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Cypress.Commands.add('mockGraphqlOps', (options) => {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// const schemaString = '';
|
||||
|
||||
interface GraphQLBody {
|
||||
operationName: string
|
||||
operationName: string;
|
||||
}
|
||||
|
||||
interface CypressAliasRequest extends Request {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ export const getMinimalMe = ({readOnly = false, classReadOnly = false, isTeacher
|
|||
};
|
||||
|
||||
const getSchoolClassNode = (id, schoolClassName) => ({
|
||||
'id': btoa(`SchoolClassNode:${id}`),
|
||||
'name': schoolClassName,
|
||||
'__typename': 'SchoolClassNode',
|
||||
id: btoa(`SchoolClassNode:${id}`),
|
||||
name: schoolClassName,
|
||||
__typename: 'SchoolClassNode',
|
||||
});
|
||||
|
||||
export const assertStartPage = (onboarding) => {
|
||||
|
|
@ -40,35 +40,35 @@ export const getMe = ({schoolClasses, teacher}) => {
|
|||
}
|
||||
|
||||
return {
|
||||
'me': {
|
||||
'id': 'VXNlck5vZGU6NQ==',
|
||||
'pk': 5,
|
||||
'username': 'rachel.green',
|
||||
'email': 'rachel.green@skillbox.example',
|
||||
'expiryDate': '3596153600',
|
||||
'firstName': 'Rachel',
|
||||
'lastName': 'Green',
|
||||
'avatarUrl': '',
|
||||
'isTeacher': teacher,
|
||||
me: {
|
||||
id: 'VXNlck5vZGU6NQ==',
|
||||
pk: 5,
|
||||
username: 'rachel.green',
|
||||
email: 'rachel.green@skillbox.example',
|
||||
expiryDate: '3596153600',
|
||||
firstName: 'Rachel',
|
||||
lastName: 'Green',
|
||||
avatarUrl: '',
|
||||
isTeacher: teacher,
|
||||
readOnly: false,
|
||||
'lastModule': {
|
||||
'id': 'TW9kdWxlTm9kZToxNw==',
|
||||
'slug': 'lohn-und-budget',
|
||||
'__typename': 'ModuleNode',
|
||||
lastModule: {
|
||||
id: 'TW9kdWxlTm9kZToxNw==',
|
||||
slug: 'lohn-und-budget',
|
||||
__typename: 'ModuleNode',
|
||||
},
|
||||
'selectedClass': {
|
||||
'id': 'U2Nob29sQ2xhc3NOb2RlOjI=',
|
||||
'__typename': 'SchoolClassNode',
|
||||
selectedClass: {
|
||||
id: 'U2Nob29sQ2xhc3NOb2RlOjI=',
|
||||
__typename: 'SchoolClassNode',
|
||||
},
|
||||
'lastTopic': {
|
||||
'id': 'VG9waWNOb2RlOjU=',
|
||||
'slug': 'geld-und-kauf',
|
||||
'__typename': 'TopicNode',
|
||||
lastTopic: {
|
||||
id: 'VG9waWNOb2RlOjU=',
|
||||
slug: 'geld-und-kauf',
|
||||
__typename: 'TopicNode',
|
||||
},
|
||||
'schoolClasses': schoolClassNodes,
|
||||
'__typename': 'UserNode',
|
||||
'onboardingVisited': true,
|
||||
'permissions': teacher ? ['users.can_manage_school_class_content'] : [],
|
||||
schoolClasses: schoolClassNodes,
|
||||
__typename: 'UserNode',
|
||||
onboardingVisited: true,
|
||||
permissions: teacher ? ['users.can_manage_school_class_content'] : [],
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
@ -76,262 +76,270 @@ export const getMe = ({schoolClasses, teacher}) => {
|
|||
export const getModules = () => {
|
||||
return {
|
||||
'lohn-und-budget': {
|
||||
'id': 'TW9kdWxlTm9kZToyOA==',
|
||||
'title': 'Lohn und Budget',
|
||||
'metaTitle': 'Modul 1',
|
||||
'teaser': 'Die Berufsbildung ist ein neuer Lebensabschnit',
|
||||
'intro': '\n <p>Sie stehen am Anfang eines neuen Lebensabschnitts. In Ihrer Rolle als Berufslernende oder Berufslernender haben Sie Verantwortung übernommen.</p>\n <p>Wie erging es Ihnen am ersten Arbeits- und Schultag?</p>\n ',
|
||||
'slug': 'lohn-und-budget',
|
||||
'heroImage': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
'solutionsEnabled': false,
|
||||
'bookmark': {
|
||||
'note': null,
|
||||
'__typename': 'ModuleBookmarkNode',
|
||||
id: 'TW9kdWxlTm9kZToyOA==',
|
||||
title: 'Lohn und Budget',
|
||||
metaTitle: 'Modul 1',
|
||||
teaser: 'Die Berufsbildung ist ein neuer Lebensabschnit',
|
||||
intro:
|
||||
'\n <p>Sie stehen am Anfang eines neuen Lebensabschnitts. In Ihrer Rolle als Berufslernende oder Berufslernender haben Sie Verantwortung übernommen.</p>\n <p>Wie erging es Ihnen am ersten Arbeits- und Schultag?</p>\n ',
|
||||
slug: 'lohn-und-budget',
|
||||
heroImage:
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
solutionsEnabled: false,
|
||||
bookmark: {
|
||||
note: null,
|
||||
__typename: 'ModuleBookmarkNode',
|
||||
},
|
||||
'__typename': 'ModuleNode',
|
||||
'assignments': {
|
||||
'edges': [
|
||||
__typename: 'ModuleNode',
|
||||
assignments: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
'title': 'Ein Auftragstitel',
|
||||
'assignment': 'Ein Auftrag',
|
||||
'solution': null,
|
||||
'submission': {
|
||||
'id': 'U3R1ZGVudFN1Ym1pc3Npb25Ob2RlOjE=',
|
||||
'text': 'Hir ist ein Feler gewesen',
|
||||
'final': false,
|
||||
'document': '',
|
||||
'submissionFeedback': {
|
||||
'id': 'U3VibWlzc2lvbkZlZWRiYWNrTm9kZTox',
|
||||
'text': '🙂😐🤬👍🤢🤢🤢🤢😮🤗',
|
||||
'teacher': {
|
||||
'firstName': 'Nico',
|
||||
'lastName': 'Zickgraf',
|
||||
'__typename': 'UserNode',
|
||||
node: {
|
||||
id: 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
title: 'Ein Auftragstitel',
|
||||
assignment: 'Ein Auftrag',
|
||||
solution: null,
|
||||
submission: {
|
||||
id: 'U3R1ZGVudFN1Ym1pc3Npb25Ob2RlOjE=',
|
||||
text: 'Hir ist ein Feler gewesen',
|
||||
final: false,
|
||||
document: '',
|
||||
submissionFeedback: {
|
||||
id: 'U3VibWlzc2lvbkZlZWRiYWNrTm9kZTox',
|
||||
text: '🙂😐🤬👍🤢🤢🤢🤢😮🤗',
|
||||
teacher: {
|
||||
firstName: 'Nico',
|
||||
lastName: 'Zickgraf',
|
||||
__typename: 'UserNode',
|
||||
},
|
||||
'__typename': 'SubmissionFeedbackNode',
|
||||
__typename: 'SubmissionFeedbackNode',
|
||||
},
|
||||
'__typename': 'StudentSubmissionNode',
|
||||
__typename: 'StudentSubmissionNode',
|
||||
},
|
||||
'__typename': 'AssignmentNode',
|
||||
__typename: 'AssignmentNode',
|
||||
},
|
||||
'__typename': 'AssignmentNodeEdge',
|
||||
__typename: 'AssignmentNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'AssignmentNodeConnection',
|
||||
__typename: 'AssignmentNodeConnection',
|
||||
},
|
||||
'objectiveGroups': {
|
||||
'edges': [],
|
||||
'__typename': 'ObjectiveGroupNodeConnection',
|
||||
objectiveGroups: {
|
||||
edges: [],
|
||||
__typename: 'ObjectiveGroupNodeConnection',
|
||||
},
|
||||
'chapters': {
|
||||
'edges': [
|
||||
chapters: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'Q2hhcHRlck5vZGU6MTg=',
|
||||
'title': '1.1 Lehrbeginn',
|
||||
'description': 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
'bookmark': null,
|
||||
'contentBlocks': {
|
||||
'edges': [
|
||||
node: {
|
||||
id: 'Q2hhcHRlck5vZGU6MTg=',
|
||||
title: '1.1 Lehrbeginn',
|
||||
description: 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
bookmark: null,
|
||||
contentBlocks: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'Q29udGVudEJsb2NrTm9kZToxOQ==',
|
||||
'slug': 'assignment',
|
||||
'title': 'Assignment',
|
||||
'type': 'NORMAL',
|
||||
'contents': [
|
||||
node: {
|
||||
id: 'Q29udGVudEJsb2NrTm9kZToxOQ==',
|
||||
slug: 'assignment',
|
||||
title: 'Assignment',
|
||||
type: 'NORMAL',
|
||||
contents: [
|
||||
{
|
||||
'type': 'assignment',
|
||||
'value': {
|
||||
'title': 'Ein Auftragstitel',
|
||||
'assignment': 'Ein Auftrag',
|
||||
'id': 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
type: 'assignment',
|
||||
value: {
|
||||
title: 'Ein Auftragstitel',
|
||||
assignment: 'Ein Auftrag',
|
||||
id: 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
},
|
||||
'id': 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
id: 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
},
|
||||
],
|
||||
'userCreated': false,
|
||||
'mine': false,
|
||||
'bookmarks': [],
|
||||
'hiddenFor': {
|
||||
'edges': [],
|
||||
'__typename': 'SchoolClassNodeConnection',
|
||||
userCreated: false,
|
||||
mine: false,
|
||||
bookmarks: [],
|
||||
hiddenFor: {
|
||||
edges: [],
|
||||
__typename: 'SchoolClassNodeConnection',
|
||||
},
|
||||
'visibleFor': {
|
||||
'edges': [],
|
||||
'__typename': 'SchoolClassNodeConnection',
|
||||
visibleFor: {
|
||||
edges: [],
|
||||
__typename: 'SchoolClassNodeConnection',
|
||||
},
|
||||
'__typename': 'ContentBlockNode',
|
||||
__typename: 'ContentBlockNode',
|
||||
},
|
||||
'__typename': 'ContentBlockNodeEdge',
|
||||
__typename: 'ContentBlockNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'ContentBlockNodeConnection',
|
||||
__typename: 'ContentBlockNodeConnection',
|
||||
},
|
||||
'__typename': 'ChapterNode',
|
||||
__typename: 'ChapterNode',
|
||||
},
|
||||
'__typename': 'ChapterNodeEdge',
|
||||
__typename: 'ChapterNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'ChapterNodeConnection',
|
||||
__typename: 'ChapterNodeConnection',
|
||||
},
|
||||
},
|
||||
'geld': {
|
||||
'id': 'TW9kdWxlTm9kZTo0Mg==',
|
||||
'title': 'Geld',
|
||||
'metaTitle': 'Modul 2',
|
||||
'teaser': ' Geld braucht jeder von uns im t\u00e4glichen Leben.',
|
||||
'intro': '\n <p>Jeder B\u00fcrger nutzt es. Nahezu jeden Tag. Kaum ein Tag vergeht, an dem wir nicht mit M\u00fcnzen oder Geldscheinen bezahlen, bargeldlose \u00dcberweisungen t\u00e4tigen oder andere Zahlungsmethoden verwenden. Doch was genau befindet sich da eigentlich in unserem Geldbeutel? Was ist das, was auf unseren Konten liegt und die Bezeichnung Geld tr\u00e4gt?</p>\n ',
|
||||
'slug': 'geld',
|
||||
'heroImage': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
'solutionsEnabled': false,
|
||||
'bookmark': null,
|
||||
'__typename': 'ModuleNode',
|
||||
'assignments': {
|
||||
'edges': [],
|
||||
'__typename': 'AssignmentNodeConnection',
|
||||
geld: {
|
||||
id: 'TW9kdWxlTm9kZTo0Mg==',
|
||||
title: 'Geld',
|
||||
metaTitle: 'Modul 2',
|
||||
teaser: ' Geld braucht jeder von uns im t\u00e4glichen Leben.',
|
||||
intro:
|
||||
'\n <p>Jeder B\u00fcrger nutzt es. Nahezu jeden Tag. Kaum ein Tag vergeht, an dem wir nicht mit M\u00fcnzen oder Geldscheinen bezahlen, bargeldlose \u00dcberweisungen t\u00e4tigen oder andere Zahlungsmethoden verwenden. Doch was genau befindet sich da eigentlich in unserem Geldbeutel? Was ist das, was auf unseren Konten liegt und die Bezeichnung Geld tr\u00e4gt?</p>\n ',
|
||||
slug: 'geld',
|
||||
heroImage:
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
solutionsEnabled: false,
|
||||
bookmark: null,
|
||||
__typename: 'ModuleNode',
|
||||
assignments: {
|
||||
edges: [],
|
||||
__typename: 'AssignmentNodeConnection',
|
||||
},
|
||||
'objectiveGroups': {
|
||||
'edges': [],
|
||||
'__typename': 'ObjectiveGroupNodeConnection',
|
||||
objectiveGroups: {
|
||||
edges: [],
|
||||
__typename: 'ObjectiveGroupNodeConnection',
|
||||
},
|
||||
'chapters': {
|
||||
'edges': [
|
||||
chapters: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'Q2hhcHRlck5vZGU6MzI=',
|
||||
'title': '2.1 Eine Welt ohne Geld?',
|
||||
'description': '',
|
||||
'bookmark': null,
|
||||
'contentBlocks': {
|
||||
'edges': [
|
||||
node: {
|
||||
id: 'Q2hhcHRlck5vZGU6MzI=',
|
||||
title: '2.1 Eine Welt ohne Geld?',
|
||||
description: '',
|
||||
bookmark: null,
|
||||
contentBlocks: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'Q29udGVudEJsb2NrTm9kZToxOQ==',
|
||||
'slug': 'assignment',
|
||||
'title': 'Assignment',
|
||||
'type': 'NORMAL',
|
||||
'contents': [
|
||||
node: {
|
||||
id: 'Q29udGVudEJsb2NrTm9kZToxOQ==',
|
||||
slug: 'assignment',
|
||||
title: 'Assignment',
|
||||
type: 'NORMAL',
|
||||
contents: [
|
||||
{
|
||||
'type': 'assignment',
|
||||
'value': {
|
||||
'title': 'Ein Auftragstitel',
|
||||
'assignment': 'Ein Auftrag',
|
||||
'id': 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
type: 'assignment',
|
||||
value: {
|
||||
title: 'Ein Auftragstitel',
|
||||
assignment: 'Ein Auftrag',
|
||||
id: 'QXNzaWdubWVudE5vZGU6MQ==',
|
||||
},
|
||||
'id': 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
id: 'df8212ee-3e82-49fa-977e-c4b60789163e',
|
||||
},
|
||||
],
|
||||
'userCreated': false,
|
||||
'mine': false,
|
||||
'bookmarks': [],
|
||||
'hiddenFor': {
|
||||
'edges': [],
|
||||
'__typename': 'SchoolClassNodeConnection',
|
||||
userCreated: false,
|
||||
mine: false,
|
||||
bookmarks: [],
|
||||
hiddenFor: {
|
||||
edges: [],
|
||||
__typename: 'SchoolClassNodeConnection',
|
||||
},
|
||||
'visibleFor': {
|
||||
'edges': [],
|
||||
'__typename': 'SchoolClassNodeConnection',
|
||||
visibleFor: {
|
||||
edges: [],
|
||||
__typename: 'SchoolClassNodeConnection',
|
||||
},
|
||||
'__typename': 'ContentBlockNode',
|
||||
__typename: 'ContentBlockNode',
|
||||
},
|
||||
'__typename': 'ContentBlockNodeEdge',
|
||||
__typename: 'ContentBlockNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'ContentBlockNodeConnection',
|
||||
__typename: 'ContentBlockNodeConnection',
|
||||
},
|
||||
'__typename': 'ChapterNode',
|
||||
__typename: 'ChapterNode',
|
||||
},
|
||||
'__typename': 'ChapterNodeEdge',
|
||||
__typename: 'ChapterNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'ChapterNodeConnection',
|
||||
__typename: 'ChapterNodeConnection',
|
||||
},
|
||||
},
|
||||
'lerntipps': {
|
||||
'id': 'TW9kdWxlTm9kZTo3MA==',
|
||||
'title': 'Lerntipps',
|
||||
'metaTitle': 'Modul 4',
|
||||
'teaser': 'Lerntipps',
|
||||
'intro': '\n <p>Sie stehen am Anfang eines neuen Lebensabschnitts. In Ihrer Rolle als Berufslernende oder Berufslernender haben Sie Verantwortung übernommen.</p>\n <p>Wie erging es Ihnen am ersten Arbeits- und Schultag?</p>\n ',
|
||||
'slug': 'lerntipps',
|
||||
'heroImage': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
'solutionsEnabled': false,
|
||||
'bookmark': {
|
||||
'note': null,
|
||||
'__typename': 'ModuleBookmarkNode',
|
||||
lerntipps: {
|
||||
id: 'TW9kdWxlTm9kZTo3MA==',
|
||||
title: 'Lerntipps',
|
||||
metaTitle: 'Modul 4',
|
||||
teaser: 'Lerntipps',
|
||||
intro:
|
||||
'\n <p>Sie stehen am Anfang eines neuen Lebensabschnitts. In Ihrer Rolle als Berufslernende oder Berufslernender haben Sie Verantwortung übernommen.</p>\n <p>Wie erging es Ihnen am ersten Arbeits- und Schultag?</p>\n ',
|
||||
slug: 'lerntipps',
|
||||
heroImage:
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
solutionsEnabled: false,
|
||||
bookmark: {
|
||||
note: null,
|
||||
__typename: 'ModuleBookmarkNode',
|
||||
},
|
||||
'__typename': 'ModuleNode',
|
||||
'assignments': {
|
||||
'edges': [],
|
||||
'__typename': 'AssignmentNodeConnection',
|
||||
__typename: 'ModuleNode',
|
||||
assignments: {
|
||||
edges: [],
|
||||
__typename: 'AssignmentNodeConnection',
|
||||
},
|
||||
'objectiveGroups': {
|
||||
'edges': [],
|
||||
'__typename': 'ObjectiveGroupNodeConnection',
|
||||
objectiveGroups: {
|
||||
edges: [],
|
||||
__typename: 'ObjectiveGroupNodeConnection',
|
||||
},
|
||||
'chapters': {
|
||||
'edges': [
|
||||
chapters: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'Q2hhcHRlck5vZGU6MTg=',
|
||||
'title': '1.1 Lehrbeginn',
|
||||
'description': 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
'bookmark': null,
|
||||
'contentBlocks': {
|
||||
'edges': [],
|
||||
'__typename': 'ContentBlockNodeConnection',
|
||||
node: {
|
||||
id: 'Q2hhcHRlck5vZGU6MTg=',
|
||||
title: '1.1 Lehrbeginn',
|
||||
description: 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
bookmark: null,
|
||||
contentBlocks: {
|
||||
edges: [],
|
||||
__typename: 'ContentBlockNodeConnection',
|
||||
},
|
||||
'__typename': 'ChapterNode',
|
||||
__typename: 'ChapterNode',
|
||||
},
|
||||
'__typename': 'ChapterNodeEdge',
|
||||
__typename: 'ChapterNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'ChapterNodeConnection',
|
||||
__typename: 'ChapterNodeConnection',
|
||||
},
|
||||
},
|
||||
'random': {
|
||||
'id': 'TW9kdWxlTm9kZTo1NA==',
|
||||
'title': 'Random',
|
||||
'metaTitle': 'Modul 5',
|
||||
'teaser': 'Random',
|
||||
'intro': '\n <p>Sie stehen am Anfang eines neuen Lebensabschnitts. In Ihrer Rolle als Berufslernende oder Berufslernender haben Sie Verantwortung übernommen.</p>\n <p>Wie erging es Ihnen am ersten Arbeits- und Schultag?</p>\n ',
|
||||
'slug': 'random',
|
||||
'heroImage': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
'solutionsEnabled': false,
|
||||
'bookmark': {
|
||||
'note': null,
|
||||
'__typename': 'ModuleBookmarkNode',
|
||||
random: {
|
||||
id: 'TW9kdWxlTm9kZTo1NA==',
|
||||
title: 'Random',
|
||||
metaTitle: 'Modul 5',
|
||||
teaser: 'Random',
|
||||
intro:
|
||||
'\n <p>Sie stehen am Anfang eines neuen Lebensabschnitts. In Ihrer Rolle als Berufslernende oder Berufslernender haben Sie Verantwortung übernommen.</p>\n <p>Wie erging es Ihnen am ersten Arbeits- und Schultag?</p>\n ',
|
||||
slug: 'random',
|
||||
heroImage:
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==',
|
||||
solutionsEnabled: false,
|
||||
bookmark: {
|
||||
note: null,
|
||||
__typename: 'ModuleBookmarkNode',
|
||||
},
|
||||
'__typename': 'ModuleNode',
|
||||
'assignments': {
|
||||
'edges': [],
|
||||
'__typename': 'AssignmentNodeConnection',
|
||||
__typename: 'ModuleNode',
|
||||
assignments: {
|
||||
edges: [],
|
||||
__typename: 'AssignmentNodeConnection',
|
||||
},
|
||||
'objectiveGroups': {
|
||||
'edges': [],
|
||||
'__typename': 'ObjectiveGroupNodeConnection',
|
||||
objectiveGroups: {
|
||||
edges: [],
|
||||
__typename: 'ObjectiveGroupNodeConnection',
|
||||
},
|
||||
'chapters': {
|
||||
'edges': [
|
||||
chapters: {
|
||||
edges: [
|
||||
{
|
||||
'node': {
|
||||
'id': 'Q2hhcHRlck5vZGU6MTg=',
|
||||
'title': '1.1 Lehrbeginn',
|
||||
'description': 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
'bookmark': null,
|
||||
'contentBlocks': {
|
||||
'edges': [],
|
||||
'__typename': 'ContentBlockNodeConnection',
|
||||
node: {
|
||||
id: 'Q2hhcHRlck5vZGU6MTg=',
|
||||
title: '1.1 Lehrbeginn',
|
||||
description: 'Wie sieht Ihr Konsumverhalten aus?',
|
||||
bookmark: null,
|
||||
contentBlocks: {
|
||||
edges: [],
|
||||
__typename: 'ContentBlockNodeConnection',
|
||||
},
|
||||
'__typename': 'ChapterNode',
|
||||
__typename: 'ChapterNode',
|
||||
},
|
||||
'__typename': 'ChapterNodeEdge',
|
||||
__typename: 'ChapterNodeEdge',
|
||||
},
|
||||
],
|
||||
'__typename': 'ChapterNodeConnection',
|
||||
__typename: 'ChapterNodeConnection',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
// Intellisense for custom Commands: https://github.com/cypress-io/cypress-example-todomvc#cypress-intellisense
|
||||
declare namespace Cypress {
|
||||
interface Chainable<Subject> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
interface Chainable<Subject> {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@
|
|||
"webpack-dev-server": "^4.6.0",
|
||||
"webpack-merge": "^5.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"prettier": "2.8.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.x",
|
||||
"npm": ">= 8.x"
|
||||
|
|
@ -7885,6 +7889,18 @@
|
|||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-prettier": {
|
||||
"version": "8.6.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz",
|
||||
"integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"eslint-config-prettier": "bin/cli.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-formatter-friendly": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-formatter-friendly/-/eslint-formatter-friendly-7.0.0.tgz",
|
||||
|
|
@ -15719,10 +15735,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||
"optional": true,
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.2.tgz",
|
||||
"integrity": "sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==",
|
||||
"devOptional": true,
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
},
|
||||
|
|
@ -25115,6 +25131,13 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"eslint-config-prettier": {
|
||||
"version": "8.6.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz",
|
||||
"integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"eslint-formatter-friendly": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-formatter-friendly/-/eslint-formatter-friendly-7.0.0.tgz",
|
||||
|
|
@ -30673,10 +30696,10 @@
|
|||
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||
"optional": true
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.2.tgz",
|
||||
"integrity": "sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==",
|
||||
"devOptional": true
|
||||
},
|
||||
"pretty": {
|
||||
"version": "2.0.0",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
"description": "skillbox vue client",
|
||||
"author": "ramon / chrigu",
|
||||
"private": true,
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "webpack serve --progress --config build/webpack.dev.conf.js",
|
||||
"analyze": "webpack --profile --json --config build/webpack.dev.conf.js > dist/stats.json && webpack-bundle-analyzer dist/stats.json",
|
||||
|
|
@ -125,5 +128,9 @@
|
|||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "^2.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"prettier": "2.8.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue