Fix broken cypress test
This commit is contained in:
parent
d4182e7e1a
commit
cccaf21c9c
|
|
@ -55,7 +55,7 @@ describe('Assignment feedback read-only - Teacher', () => {
|
|||
// cy.get('@textarea').should('have.attr', 'readonly');
|
||||
|
||||
cy.isSubmissionReadOnly(myText);
|
||||
cy.canReopen(false);
|
||||
cy.getByDataCy('final-submission-reopen').should('not.exist');
|
||||
});
|
||||
it('can edit', () => {
|
||||
cy.mockGraphqlOps({
|
||||
|
|
@ -63,6 +63,7 @@ describe('Assignment feedback read-only - Teacher', () => {
|
|||
});
|
||||
|
||||
cy.visit('submission/submission-id');
|
||||
cy.canReopen(false);
|
||||
|
||||
cy.getByDataCy('final-submission-reopen').should('exist');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ describe('Assignments read-only - Student', () => {
|
|||
cy.visit('module/module-with-assignment');
|
||||
|
||||
cy.isSubmissionReadOnly(myText);
|
||||
cy.canReopen(false);
|
||||
cy.getByDataCy('final-submission-reopen').should('not.exist');
|
||||
});
|
||||
|
||||
it('can revoke turn in', () => {
|
||||
|
|
@ -110,6 +110,6 @@ describe('Assignments read-only - Student', () => {
|
|||
|
||||
cy.visit('module/module-with-assignment');
|
||||
cy.getByDataCy('final-submission').should('exist');
|
||||
cy.canReopen(false);
|
||||
cy.getByDataCy('final-submission-reopen').should('not.exist');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -146,11 +146,6 @@ Cypress.Commands.add('fakeLogin', () => {
|
|||
cy.setCookie('loginStatus', 'true');
|
||||
});
|
||||
|
||||
Cypress.Commands.add('canReopen', (exists) => {
|
||||
let check = exists ? 'exist' : 'not.exist';
|
||||
cy.getByDataCy('final-submission-reopen').should(check);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('isSubmissionReadOnly', (myText) => {
|
||||
cy.get('.submission-form__textarea--readonly').as('textarea');
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ declare namespace Cypress {
|
|||
|
||||
fakeLogin(username: string, password: string): void
|
||||
|
||||
canReopen(exists: boolean): void
|
||||
|
||||
isSubmissionReadOnly(myText: string): void
|
||||
|
||||
openSidebar(): void
|
||||
|
|
|
|||
Loading…
Reference in New Issue