skillbox/client/cypress/integration/frontend/objectives/objectives-visibility.spec.js

89 lines
1.8 KiB
JavaScript

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,
});
});
});
//todo: finish writing this test, this does nothing
it.skip('should display the correct objectives', () => {
cy.fakeLogin('rachel.green', 'test');
cy.visit('/module/lohn-und-budget');
});
});