Update class selection bug
This commit is contained in:
parent
51fddbdf60
commit
16e8916d5c
|
|
@ -246,29 +246,38 @@ describe('The Room Page', () => {
|
||||||
it.only('changes class while on room page', () => {
|
it.only('changes class while on room page', () => {
|
||||||
const {me} = MeQuery;
|
const {me} = MeQuery;
|
||||||
const otherClass = {
|
const otherClass = {
|
||||||
id: btoa('SchoolClassNode:34'),
|
id: btoa('SchoolClassNode:34'),
|
||||||
name: 'Other Class',
|
name: 'Other Class',
|
||||||
readOnly: false
|
readOnly: false
|
||||||
};
|
};
|
||||||
|
let selectedClass = me.selectedClass;
|
||||||
const operations = {
|
const operations = {
|
||||||
MeQuery: {
|
MeQuery: () => {
|
||||||
|
return {
|
||||||
me: {
|
me: {
|
||||||
...me,
|
...me,
|
||||||
schoolClasses: [...me.schoolClasses, otherClass],
|
schoolClasses: [...me.schoolClasses, otherClass],
|
||||||
|
selectedClass
|
||||||
},
|
},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
RoomEntriesQuery,
|
RoomEntriesQuery,
|
||||||
UpdateSettings: {
|
UpdateSettings() {
|
||||||
updateSettings: {
|
selectedClass = otherClass;
|
||||||
success: true
|
return {
|
||||||
}
|
updateSettings: {
|
||||||
|
success: true
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
ModuleDetailsQuery: {
|
ModuleDetailsQuery: {},
|
||||||
me: {
|
MySchoolClassQuery: () => {
|
||||||
selectedClass: otherClass
|
return {
|
||||||
}
|
me: {
|
||||||
|
selectedClass
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
MySchoolClassQuery: {},
|
|
||||||
RoomsQuery: {
|
RoomsQuery: {
|
||||||
rooms: []
|
rooms: []
|
||||||
}
|
}
|
||||||
|
|
@ -281,6 +290,6 @@ describe('The Room Page', () => {
|
||||||
cy.getByDataCy('room-title').should('contain', 'A Room');
|
cy.getByDataCy('room-title').should('contain', 'A Room');
|
||||||
cy.selectClass('Other Class');
|
cy.selectClass('Other Class');
|
||||||
cy.url().should('include', 'rooms');
|
cy.url().should('include', 'rooms');
|
||||||
cy.getByDataCy('selected-class-name').should('contain', 'Other Class');
|
cy.getByDataCy('current-class-name').should('contain', 'Other Class');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
updateSelectedClassAndHidePopover(selectedClass) {
|
updateSelectedClassAndHidePopover(selectedClass) {
|
||||||
this.updateSelectedClass(selectedClass);
|
this.updateSelectedClass(selectedClass);
|
||||||
this.showPopover = false;
|
this.showPopover = false;
|
||||||
this.closeSidebar();
|
this.closeSidebar('profile');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue