Add test to check solution display in surveys
This commit is contained in:
parent
00b2b02113
commit
6b8b520bc5
|
|
@ -27,6 +27,13 @@ describe('Solutions', () => {
|
|||
cy.get('[data-cy=toggle-enable-solutions]')
|
||||
.should('not.exist');
|
||||
cy.get('[data-cy=solution]').should('not.exist');
|
||||
|
||||
cy.visit('/survey/U3VydmV5Tm9kZTox');
|
||||
|
||||
cy.get('.survey__page').should('exist');
|
||||
cy.get('[data-cy=solution]').should('not.exist');
|
||||
cy.get('.close-button').click();
|
||||
|
||||
cy.logout();
|
||||
|
||||
cy.visit('/module/lohn-und-budget');
|
||||
|
|
@ -54,6 +61,11 @@ describe('Solutions', () => {
|
|||
.should('contain', 'ausblenden');
|
||||
});
|
||||
|
||||
cy.visit('/survey/U3VydmV5Tm9kZTox');
|
||||
|
||||
cy.get('.survey__page').should('exist');
|
||||
cy.get('[data-cy=solution]').should('exist');
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from django.core.management import BaseCommand
|
||||
|
||||
from books.factories import ModuleFactory
|
||||
from books.models import Module
|
||||
from portfolio.factories import ProjectFactory
|
||||
from portfolio.models import ProjectEntry
|
||||
from surveys.models import Survey
|
||||
|
|
@ -17,13 +18,15 @@ survey_data = {
|
|||
{
|
||||
"name": "A: Max gibt ihr das Geld und muss das Billardspiel absagen.",
|
||||
"placeHolder": "Passende Tugenden erfassen...",
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"correctAnswer": "Triss"
|
||||
},
|
||||
{
|
||||
"name": "question2",
|
||||
"placeHolder": "Passende Tugenden erfassen...",
|
||||
"title": "B: Max gibt ihr das Geld nicht und geht Billard spielen.",
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"correctAnswer": "Jaskier"
|
||||
}
|
||||
],
|
||||
"name": "Fall 1",
|
||||
|
|
@ -43,13 +46,15 @@ survey_data = {
|
|||
"placeHolder": "Passende Tugenden erfassen...",
|
||||
"title": "A: Silvio bringt seinen Mitfahrer in Sicherheit.",
|
||||
"type": "text",
|
||||
"useDisplayValuesInTitle": False
|
||||
"useDisplayValuesInTitle": False,
|
||||
"correctAnswer": "Yennefer"
|
||||
},
|
||||
{
|
||||
"name": "question3",
|
||||
"placeHolder": "Passende Tugenden erfassen...",
|
||||
"title": "B: Silvio sperrt die Strasse ab.",
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"correctAnswer": "Geralt"
|
||||
}
|
||||
],
|
||||
"name": "panel1",
|
||||
|
|
@ -70,7 +75,7 @@ class Command(BaseCommand):
|
|||
Survey.objects.all().delete()
|
||||
self.stdout.write("Creating survey")
|
||||
|
||||
module = ModuleFactory()
|
||||
module = Module.objects.get(slug='lohn-und-budget')
|
||||
|
||||
Survey.objects.create(
|
||||
title='Test',
|
||||
|
|
|
|||
Loading…
Reference in New Issue