File tree 3 files changed +11
-3
lines changed
cypress/e2e/functional/teacher_tests
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export default defineConfig({
28
28
qaUnitTeacher6Network : "/?appMode=qa&fakeClass=5&fakeUser=teacher:6&problem=1.1&unit=./demo/units/qa/content.json&network=foo" ,
29
29
qaNoGroupShareUnitStudent5 : "/?appMode=qa&fakeClass=5&fakeUser=student:5&qaGroup=5&problem=1.1&unit=./demo/units/qa-no-group-share/content.json" ,
30
30
qaConfigSubtabsUnitStudent5 : "/?appMode=qa&fakeClass=5&fakeUser=student:5&qaGroup=5&problem=1.1&unit=./demo/units/qa-config-subtabs/content.json" ,
31
- qaConfigSubtabsUnitTeacher1 : "/?appMode=qa&fakeClass=5&fakeUser=teacher:1&qaGroup=5& problem=1.1&unit=./demo/units/qa-config-subtabs/content.json" ,
31
+ qaConfigSubtabsUnitTeacher1 : "/?appMode=qa&fakeClass=5&fakeUser=teacher:1&problem=1.1&unit=./demo/units/qa-config-subtabs/content.json" ,
32
32
qaNoNavPanelUnitStudent5 : "/?appMode=qa&fakeClass=5&fakeUser=student:5&qaGroup=5&problem=1.1&unit=./demo/units/qa-no-nav-panel/content.json" ,
33
33
qaVariablesUnitStudent5 : "/?appMode=qa&fakeClass=5&fakeUser=student:5&qaGroup=5&problem=1.1&unit=./demo/units/qa-variables/content.json" ,
34
34
qaShowNavPanelUnitStudent5 : "/?appMode=qa&fakeClass=5&fakeUser=student:5&qaGroup=5&problem=1.1&unit=./demo/units/qa-show-nav-panel/content.json" ,
Original file line number Diff line number Diff line change @@ -19,15 +19,22 @@ function verifySwitch(publicOrPrivate) {
19
19
clueCanvas . getShareButton ( ) . should ( 'have.class' , publicOrPrivate ) ;
20
20
}
21
21
22
+ function verifySectionsAreLoaded ( ) {
23
+ cy . get ( '.section-header-label' ) . should ( "contain" , "Group 5" ) ;
24
+ cy . get ( '.section-header-label' ) . should ( "contain" , "No Group" ) ;
25
+ }
26
+
22
27
function verifyStudentSeesAsPrivate ( ) {
23
28
cy . get ( '.tab-sort-work' ) . click ( ) ;
29
+ verifySectionsAreLoaded ( ) ;
24
30
cy . get ( '.section-header-arrow' ) . click ( { multiple : true } ) ;
25
31
cy . contains ( '[data-test="sort-work-list-items"]' , 'Teacher 1:' )
26
32
. should ( 'have.descendants' , '.thumbnail-private' ) ;
27
33
}
28
34
29
35
function verifyStudentSeesAsPublic ( ) {
30
36
cy . get ( '.tab-sort-work' ) . click ( ) ;
37
+ verifySectionsAreLoaded ( ) ;
31
38
cy . get ( '.section-header-arrow' ) . click ( { multiple : true } ) ;
32
39
cy . contains ( '[data-test="sort-work-list-items"]' , 'Teacher 1:' )
33
40
. should ( 'not.have.descendants' , '.thumbnail-private' ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function resolveAppMode(
22
22
stores : IStores ,
23
23
rawFirebaseJWT : string | undefined
24
24
) {
25
- const { appMode, db, ui} = stores ;
25
+ const { appMode, db, ui, user } = stores ;
26
26
if ( appMode === "authed" ) {
27
27
if ( rawFirebaseJWT ) {
28
28
return db . connect ( { appMode, stores, rawFirebaseJWT} ) . catch ( error => ui . setError ( error ) ) ;
@@ -34,7 +34,8 @@ function resolveAppMode(
34
34
else {
35
35
return db . connect ( { appMode, stores} )
36
36
. then ( ( ) => {
37
- if ( appMode === "qa" ) {
37
+ // Only students can be part of groups
38
+ if ( appMode === "qa" && user . isStudent ) {
38
39
const { qaGroup} = urlParams ;
39
40
if ( qaGroup ) {
40
41
db . leaveGroup ( ) . then ( ( ) => db . joinGroup ( qaGroup ) ) ;
You can’t perform that action at this time.
0 commit comments