skillbox/client/cypress/integration/spellcheck.spec.js

42 lines
998 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,
operations: {
MeQuery: {
me: {
permissions: [],
onboardingVisited: true
}
},
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);
});
});