Fix cypress test
This commit is contained in:
parent
99856af550
commit
f4d7f5f336
|
|
@ -181,14 +181,41 @@ describe('Class Management', () => {
|
|||
cy.get('[data-cy=old-class-item]').should('have.length', 1);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe('Teacher Class Management', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.server();
|
||||
|
||||
cy.mockGraphql({
|
||||
schema: schema,
|
||||
});
|
||||
|
||||
cy.viewport('macbook-15');
|
||||
cy.apolloLogin('nico.zickgraf', 'test');
|
||||
|
||||
});
|
||||
|
||||
it('changes class name', () => {
|
||||
let className = 'Gotta have class';
|
||||
|
||||
let localMe = {
|
||||
me: {
|
||||
...me.me,
|
||||
isTeacher: true
|
||||
}
|
||||
};
|
||||
|
||||
cy.mockGraphqlOps({
|
||||
operations: {
|
||||
MeQuery: me,
|
||||
MySchoolClassQuery: selectedClass,
|
||||
MeQuery: localMe,
|
||||
MySchoolClassQuery: {
|
||||
me: {
|
||||
...selectedClass.me,
|
||||
isTeacher: true
|
||||
}
|
||||
},
|
||||
UpdateSchoolClass: {
|
||||
updateSchoolClass: {
|
||||
success: true,
|
||||
|
|
@ -210,13 +237,18 @@ describe('Class Management', () => {
|
|||
cy.get('[data-cy=school-class-name]').should('contain', className);
|
||||
});
|
||||
|
||||
// fixme: cache misbehaves with mequery, but only for test
|
||||
|
||||
// // fixme: cache misbehaves with mequery, but only for test
|
||||
//
|
||||
// it.only('creates a new class', () => {
|
||||
// const name = 'Moordale';
|
||||
// const id = 'U2Nob29sQ2xhc3NOb2RlOjI=';
|
||||
// const __typename = "SchoolClassNode";
|
||||
// let localMe = {...me};
|
||||
// let localMe = {
|
||||
// me: {
|
||||
// ...me.me,
|
||||
// isTeacher: true
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// cy.mockGraphqlOps({
|
||||
// operations: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue