44 lines
928 B
JavaScript
44 lines
928 B
JavaScript
import minimalModule from '../../../fixtures/module.minimal';
|
|
|
|
const getOperations = ({readOnly}) => ({
|
|
MeQuery: {
|
|
me: {
|
|
onboardingVisited: true,
|
|
readOnly,
|
|
isTeacher: true
|
|
},
|
|
},
|
|
ModuleDetailsQuery: {
|
|
module: {
|
|
...minimalModule
|
|
}
|
|
},
|
|
});
|
|
|
|
describe('Module Navigation - read only', () => {
|
|
beforeEach(() => {
|
|
cy.setup();
|
|
});
|
|
|
|
it('is not shown', () => {
|
|
cy.mockGraphqlOps({
|
|
operations: getOperations({readOnly: true}),
|
|
});
|
|
|
|
cy.visit('module/module-slug');
|
|
|
|
cy.getByDataCy('module-navigation').should('exist');
|
|
cy.getByDataCy('module-teacher-menu').should('not.exist');
|
|
});
|
|
it('is shown', () => {
|
|
cy.mockGraphqlOps({
|
|
operations: getOperations({readOnly: false}),
|
|
});
|
|
|
|
cy.visit('module/module-slug');
|
|
|
|
cy.getByDataCy('module-navigation').should('exist');
|
|
cy.getByDataCy('module-teacher-menu').should('exist');
|
|
});
|
|
});
|