Fix assignment tests

This commit is contained in:
Ramon Wenger 2024-04-09 15:13:31 +02:00
parent 9e17ac3335
commit eae01e1d86
2 changed files with 10 additions and 6 deletions

View File

@ -81,10 +81,11 @@ describe('Assignments read-only - Student', () => {
cy.get('@textarea').should('not.have.attr', 'readonly');
cy.getByDataCy('submission-form-submit').should('exist');
cy.getByDataCy('final-submission').should('not.exist');
});
// todo: very flaky test, fix and re-enable
it.skip('can not edit or turn in', () => {
it('can not edit or turn in', () => {
cy.mockGraphqlOps({
operations: getOperations({ final: false, readOnly: true }),
});
@ -92,6 +93,7 @@ describe('Assignments read-only - Student', () => {
cy.isSubmissionReadOnly(myText);
cy.getByDataCy('final-submission-reopen').should('not.exist');
cy.getByDataCy('final-submission-explanation').should('not.exist');
});
it('can revoke turn in', () => {
@ -122,5 +124,6 @@ describe('Assignments read-only - Student', () => {
cy.isSubmissionReadOnly(myText);
cy.getByDataCy('final-submission-reopen').should('not.exist');
cy.getByDataCy('final-submission-explanation').should('not.exist');
});
});

View File

@ -8,13 +8,16 @@
class="final-submission__document"
v-if="userInput.document"
/>
<div class="final-submission__explanation">
<div
class="final-submission__explanation"
data-cy="final-submission-explanation"
v-if="showReopen"
>
<info-icon class="final-submission__explanation-icon" />
<span class="final-submission__explanation-text">{{ sharedMsg }}</span>
<a
class="final-submission__reopen"
data-cy="final-submission-reopen"
v-if="showReopen"
@click="$emit('reopen')"
>Bearbeiten</a
>
@ -25,9 +28,7 @@
<script>
import { newLineToParagraph } from '@/helpers/text';
import { defineAsyncComponent } from 'vue';
const DocumentBlock = defineAsyncComponent(() =>
import('@/components/content-blocks/DocumentBlock.vue')
);
const DocumentBlock = defineAsyncComponent(() => import('@/components/content-blocks/DocumentBlock.vue'));
const InfoIcon = defineAsyncComponent(() => import('@/components/icons/InfoIcon.vue'));