42 lines
995 B
JavaScript
42 lines
995 B
JavaScript
const schema = require('../fixtures/schema.json');
|
|
const assignments = require('../fixtures/assignments.json');
|
|
const module = require('../fixtures/module.json');
|
|
const spellCheck = require('../fixtures/spell-check.json');
|
|
|
|
describe('Spellcheck', () => {
|
|
before(() => {
|
|
cy.server();
|
|
cy.mockGraphql({
|
|
schema: schema,
|
|
// endpoint: '/api/graphql'
|
|
operations: {
|
|
MeQuery: {
|
|
me: {
|
|
permissions: []
|
|
}
|
|
},
|
|
AssignmentsQuery: {
|
|
assignments
|
|
},
|
|
ModulesQuery: {
|
|
module
|
|
},
|
|
SpellCheck: {
|
|
spellCheck
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
it('should highlight three errors', () => {
|
|
cy.apolloLogin('rahel.cueni', 'test');
|
|
cy.visit('/module/lohn-und-budget/');
|
|
|
|
cy.get('.spellcheck__correction').should('have.length', 0);
|
|
|
|
cy.get('.submission-form-container__spellcheck').click();
|
|
|
|
cy.get('.spellcheck__correction').should('have.length', 3);
|
|
});
|
|
});
|