|
1 | 1 | import { Context } from '@graasp/sdk'; |
2 | 2 |
|
3 | | -import { TextAppDataData } from '../../../src/components/types/types'; |
| 3 | +import { |
| 4 | + AppSettingData, |
| 5 | + TextAppDataData, |
| 6 | +} from '../../../src/components/types/types'; |
4 | 7 | import { |
5 | 8 | APP_SETTING_NAMES, |
6 | 9 | FILL_BLANKS_TYPE, |
@@ -37,7 +40,7 @@ const id = data.questionId; |
37 | 40 | const { text } = data as TextAppDataData; |
38 | 41 | const { answers, words } = splitSentence(text); |
39 | 42 |
|
40 | | -const explanationShouldNotBeVisible = () => cy.checkExplanationPlay(undefined); |
| 43 | +const fillBlanksAppSettingsData = APP_SETTINGS[3].data as AppSettingData; |
41 | 44 |
|
42 | 45 | // verify all answers styles |
43 | 46 | const checkCorrection = ( |
@@ -89,7 +92,7 @@ const checkCorrection = ( |
89 | 92 | if (shouldBeVisible) { |
90 | 93 | cy.checkExplanationPlay(data.explanation); |
91 | 94 | } else { |
92 | | - explanationShouldNotBeVisible(); |
| 95 | + cy.checkExplanationPlay(null); |
93 | 96 | } |
94 | 97 | }); |
95 | 98 | }; |
@@ -193,6 +196,7 @@ describe('Play Fill In The Blanks', () => { |
193 | 196 | ); |
194 | 197 | } |
195 | 198 | }); |
| 199 | + cy.checkHintsPlay(null); |
196 | 200 | cy.checkExplanationPlay(null); |
197 | 201 | checkInputDisabled(false); |
198 | 202 | cy.checkNumberOfAttemptsProgression({ |
@@ -235,6 +239,9 @@ describe('Play Fill In The Blanks', () => { |
235 | 239 |
|
236 | 240 | checkCorrection(splitSentence(data.text)); |
237 | 241 |
|
| 242 | + // hints should be hidden |
| 243 | + cy.checkHintsPlay(null); |
| 244 | + |
238 | 245 | // success displayed in question bar |
239 | 246 | cy.checkStepStatus(id, true); |
240 | 247 |
|
@@ -267,6 +274,9 @@ describe('Play Fill In The Blanks', () => { |
267 | 274 | const data = partiallyCorrectAppData.data; |
268 | 275 | checkCorrection(splitSentence(data.text)); |
269 | 276 |
|
| 277 | + // hints should be hidden |
| 278 | + cy.checkHintsPlay(null); |
| 279 | + |
270 | 280 | // success displayed in question bar |
271 | 281 | cy.checkStepStatus(id, false); |
272 | 282 |
|
@@ -298,6 +308,9 @@ describe('Play Fill In The Blanks', () => { |
298 | 308 | const data = shorterAppData.data; |
299 | 309 | checkCorrection(splitSentence(data.text)); |
300 | 310 |
|
| 311 | + // hints should be hidden |
| 312 | + cy.checkHintsPlay(null); |
| 313 | + |
301 | 314 | // success displayed in question bar |
302 | 315 | cy.checkStepStatus(id, false); |
303 | 316 |
|
@@ -326,6 +339,9 @@ describe('Play Fill In The Blanks', () => { |
326 | 339 | cy.visit('/'); |
327 | 340 | cy.get(dataCyWrapper(buildQuestionStepCy(id))).click(); |
328 | 341 |
|
| 342 | + // hints should be hidden |
| 343 | + cy.checkHintsPlay(null); |
| 344 | + |
329 | 345 | // we do not check correction: nothing matches |
330 | 346 | // but we want to know that the app didn't crash |
331 | 347 |
|
@@ -400,6 +416,9 @@ describe('Play Fill In The Blanks', () => { |
400 | 416 |
|
401 | 417 | checkCorrection(splitSentence(data.text)); |
402 | 418 |
|
| 419 | + // hints should be hidden |
| 420 | + cy.checkHintsPlay(null); |
| 421 | + |
403 | 422 | // success displayed in question bar |
404 | 423 | cy.checkStepStatus(id, true); |
405 | 424 |
|
@@ -435,6 +454,9 @@ describe('Play Fill In The Blanks', () => { |
435 | 454 | const data = partiallyCorrectAppData.data; |
436 | 455 | checkCorrection(splitSentence(data.text), false); |
437 | 456 |
|
| 457 | + // hints should be displayed |
| 458 | + cy.checkHintsPlay(fillBlanksAppSettingsData.hints); |
| 459 | + |
438 | 460 | // success displayed in question bar |
439 | 461 | cy.checkStepStatus(id, false); |
440 | 462 |
|
@@ -469,6 +491,9 @@ describe('Play Fill In The Blanks', () => { |
469 | 491 | const data = shorterAppData.data; |
470 | 492 | checkCorrection(splitSentence(data.text), false); |
471 | 493 |
|
| 494 | + // hints should be displayed |
| 495 | + cy.checkHintsPlay(fillBlanksAppSettingsData.hints); |
| 496 | + |
472 | 497 | // success displayed in question bar |
473 | 498 | cy.checkStepStatus(id, false); |
474 | 499 |
|
@@ -500,6 +525,9 @@ describe('Play Fill In The Blanks', () => { |
500 | 525 | cy.visit('/'); |
501 | 526 | cy.get(dataCyWrapper(buildQuestionStepCy(id))).click(); |
502 | 527 |
|
| 528 | + // hints should be displayed |
| 529 | + cy.checkHintsPlay(fillBlanksAppSettingsData.hints); |
| 530 | + |
503 | 531 | // we do not check correction: nothing matches |
504 | 532 | // but we want to know that the app didn't crash |
505 | 533 |
|
|
0 commit comments