Add 2 new frontend tests
This commit is contained in:
parent
fb9ba7d2bb
commit
1f85defb2a
|
|
@ -0,0 +1 @@
|
|||
schema: 'server/schema.graphql'
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
import {getMe} from '../../support/helpers';
|
||||
import mocks from '../../fixtures/mocks';
|
||||
|
||||
const modules = {
|
||||
'lohn-und-budget': {
|
||||
'objectiveGroups': {
|
||||
'edges': [
|
||||
{
|
||||
'node': {
|
||||
'title': 'LANGUAGE_COMMUNICATION',
|
||||
'objectives': {
|
||||
'edges': [
|
||||
{
|
||||
'node': {
|
||||
'text': 'i-am-an-objective',
|
||||
'hiddenFor': {
|
||||
'edges': [],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const operations = {
|
||||
MeQuery() {
|
||||
return getMe({
|
||||
schoolClasses: ['FLID2018a'],
|
||||
teacher: false,
|
||||
});
|
||||
},
|
||||
ModulesQuery: modules,
|
||||
MySchoolClassQuery: {
|
||||
me: {},
|
||||
},
|
||||
UpdateLastModule: {
|
||||
updateLastModule: {
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
SyncModuleVisibility: {
|
||||
syncModuleVisibility: {
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// const mocks = {
|
||||
// UUID: () => 'Whatever',
|
||||
// GenericStreamFieldType: () => [],
|
||||
// ObjectiveGroup: () => ({}),
|
||||
// Module: () => ({
|
||||
// title: 'title',
|
||||
// slug: 'slug',
|
||||
// metaTitle: 'metaTitle',
|
||||
// teaser: 'teaser',
|
||||
// intro: 'intro',
|
||||
// assignments: {edges: []},
|
||||
// objectiveGroups: {edges: []},
|
||||
// id: 'ID',
|
||||
// }),
|
||||
// };
|
||||
|
||||
describe('Objective Visibility', () => {
|
||||
beforeEach(() => {
|
||||
cy.server();
|
||||
cy.task('getSchema').then(schema => {
|
||||
cy.mockGraphql({
|
||||
schema,
|
||||
// endpoint: '/api/graphql'
|
||||
mocks,
|
||||
operations,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should display the correct objectives', () => {
|
||||
cy.fakeLogin('rahel.cueni', 'test');
|
||||
|
||||
cy.visit('/module/lohn-und-budget');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue