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

88 lines
1.7 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.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');
});
});