fcad-core-dragon 2.2.0-beta.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG +10 -0
- package/artifacts/playwright-report/index.html +1 -1
- package/package.json +2 -1
- package/src/components/AppCompBranchButtons.vue +6 -3
- package/src/components/AppCompMenuItem.vue +2 -2
- package/src/components/AppCompNoteCredit.vue +17 -19
- package/src/components/AppCompPlayBarNext.vue +11 -3
- package/src/components/AppCompQuizRecall.vue +7 -13
- package/src/main.js +3 -2
- package/src/module/stores/appStore.js +0 -7
- package/src/plugins/i18n.js +1 -2
- package/src/shared/validators.js +8 -21
- package/tests/mocks/routes.mock.js +2 -0
- package/tests/unit/AppCompAudio.spec.js +6 -1
- package/tests/unit/AppCompBranchButtons.spec.js +172 -0
- package/tests/unit/AppCompCarousel.spec.js +11 -3
- package/tests/unit/AppCompNoteCredit.spec.js +142 -36
- package/tests/unit/AppCompPlayBarNext.spec.js +428 -0
- package/tests/unit/AppCompVideoPlayer.spec.js +6 -3
- package/tests/utility/colors.js +10 -0
- package/vitest.config.js +20 -8
- package/vitest.setup.js +35 -33
- package/.vscode/extensions.json +0 -8
- package/.vscode/settings.json +0 -16
- package/tests/unit/AppCompQuizNext.spec.js +0 -112
package/CHANGELOG
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
2.2.0(21 janvier 2026)
|
|
2
|
+
Voir corrections des versions 2.2.0-beta
|
|
3
|
+
|
|
4
|
+
2.2.0-beta.2(8 janvier 2026)
|
|
5
|
+
Correction du comportement de la playbar du lecteur vidéo (elle reste toujours visible, sauf en plein écran)
|
|
6
|
+
|
|
7
|
+
Correction de l’affichage du contenu de la section info (notes et sources) quand il n’y a que des notes ou que des sources
|
|
8
|
+
|
|
9
|
+
Correction du rappel de réponse ("skeleton" qui restait bloqué)
|
|
10
|
+
|
|
1
11
|
2.2.0-beta.1(19 décembre 2025) ***Changements majeurs*** main.js et i18n.js doivent être remplacés dans vos cours
|
|
2
12
|
Correction texte troué et texte troué listes déroulantes (fin de texte manquante)
|
|
3
13
|
|
|
@@ -82,4 +82,4 @@ Error generating stack: `+n.message+`
|
|
|
82
82
|
<div id='root'></div>
|
|
83
83
|
</body>
|
|
84
84
|
</html>
|
|
85
|
-
<script id="playwrightReportBase64" type="application/zip">data:application/zip;base64,
|
|
85
|
+
<script id="playwrightReportBase64" type="application/zip">data:application/zip;base64,UEsDBBQAAAgIACNyNVyU+qcBHBAAALBdAQAZAAAAM2NlOWYxNmYwM2E5OWI0Mzg4MTkuanNvbu1d647bxhV+FYIo4DUgczlXctQ0qB24cIA0PwK3BZp1E15GXmYlckFSthdbP0J/9An6in2ElpTslYaUeNeNJ0AAeSkdDjnfmcv5zpzvUZ8Fc/m9r0914kkxQ3xmEkcIlxLbRkKf5Nd/dBZSn+ov7+9fOYl8tUzTKDSSe+kZvyX6RE9lkib69OfH/NNOYy887phSuC62PURdggRxafbzIJ1n5r9PtViGvowTzdHc/Cb6RL+Po9+kl66b4N3G0SJYLvSJPo88Jw2iUJ8+5o3c08B5EEp9iulE96L5chHqU/J5ovvLeG2AUTbRnTCM0vwP2bO8m+ip8379KVqmXpTfX366l14q/axhTnqrT39WbvphKfV3Ez2WyXK+finKfZLUidO3QW4Om5i/MNELjN4iMUV8yohhM/R3PbOQxg/61Mx+IO/Xr3f9pl7JWRRL7U0U3WWPV22RZxaf2oFMyyqz6+Z2XzverXYbRXe1TNsF06zM9J+CT+kyltqN7sbRx0TGN3od87bScmaRMus/OMvQu9XWpmsYFiZRDDP+ZPjdRHfS1PFuFzJM13/womWY6lM00ZO74P5e+vp05swT+bnRlydlb8SLwlR+Smu8EWpQLpQXzlq2u7Qp9857Wa8dNttuByalPfNdLJ1UapndWlYt1So6WrfUfhcWUvuEVHRKydhlGNeGcR1GvvxlEfnLuUyu/3g/dx4+xsH72/Q6G3jiIDPhzF946QsviuV1EPry0+YQl933yxCHszFu1xNP9CTM/p3qU127WZomcn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23
|
"@playwright/test": "^1.56.1",
|
|
24
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
24
25
|
"@types/node": "^24.10.0",
|
|
25
26
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
26
27
|
"@vitest/coverage-v8": "^4.0.15",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"watch": "nodemon -e js,vue,html,json -x yalc publish --push"
|
|
66
67
|
},
|
|
67
68
|
"type": "module",
|
|
68
|
-
"version": "2.2.0
|
|
69
|
+
"version": "2.2.0"
|
|
69
70
|
}
|
|
@@ -250,6 +250,7 @@ export default {
|
|
|
250
250
|
this.isCard = this.cards && Object.keys(this.cards).length != 0
|
|
251
251
|
this.idActivity = this.$router.currentRoute.value.meta.activity_ref
|
|
252
252
|
this.branchs = this.$router.currentRoute.value.meta.children
|
|
253
|
+
|
|
253
254
|
this.getbranchsData()
|
|
254
255
|
},
|
|
255
256
|
methods: {
|
|
@@ -271,7 +272,7 @@ export default {
|
|
|
271
272
|
branchData.progression = progression
|
|
272
273
|
if (isNaN(branchData.progression)) branchData.progression = 0
|
|
273
274
|
|
|
274
|
-
if (this.isCard) {
|
|
275
|
+
if (this.isCard && this.getMatchingElement(branchData.id)) {
|
|
275
276
|
const { title, text, imgFile, imgAlt, btnTitle } =
|
|
276
277
|
this.getMatchingElement(branchData.id)
|
|
277
278
|
|
|
@@ -476,12 +477,14 @@ export default {
|
|
|
476
477
|
* @return {Object} Matching element from
|
|
477
478
|
*/
|
|
478
479
|
getMatchingElement(id) {
|
|
480
|
+
let matchingBranch = null
|
|
479
481
|
if (this.isCustomButton) {
|
|
480
|
-
|
|
482
|
+
matchingBranch = this.customButtons.find((c) => c.brchName === id)
|
|
481
483
|
}
|
|
482
484
|
if (this.isCard) {
|
|
483
|
-
|
|
485
|
+
matchingBranch = this.cards.find((c) => c.brchName === id)
|
|
484
486
|
}
|
|
487
|
+
return matchingBranch ? matchingBranch : null
|
|
485
488
|
}
|
|
486
489
|
}
|
|
487
490
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
@ Description: This component is used to display and create the
|
|
3
|
-
@ What it does: Goes
|
|
2
|
+
@ Description: This component is used to display and create the links for all the activities in module.
|
|
3
|
+
@ What it does: Goes through all the activities in the router and create a card that navigate to the corresponding activity. Display the title and subtitle enter in menu.json. Must be used with AppCompTableOfContent and AppCompMenu.
|
|
4
4
|
-->
|
|
5
5
|
<template>
|
|
6
6
|
<v-row v-if="activities.length" class="box-msa">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
:error-text="`Vous avez une/des erreur(s) dans la création des notes/crédits.`"
|
|
27
27
|
></app-base-error-display>
|
|
28
28
|
<template v-else>
|
|
29
|
-
<div v-if="
|
|
29
|
+
<div v-if="hasNotes" class="ctn-note">
|
|
30
30
|
<p class="t-note">{{ $t('text.title_note') }}</p>
|
|
31
31
|
<div id="notes-list">
|
|
32
32
|
<template
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
64
|
</div>
|
|
65
|
-
<div v-if="
|
|
65
|
+
<div v-if="hasCredits" class="ctn-credit">
|
|
66
66
|
<p class="t-crdt">{{ $t('text.title_credit') }}</p>
|
|
67
67
|
|
|
68
68
|
<ul id="credits-list">
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
v-for="(credit, index) of credits"
|
|
71
71
|
:key="`credit_${index + 1}`"
|
|
72
72
|
:ref="`#nt_${index + 1}`"
|
|
73
|
+
class="item-credits"
|
|
73
74
|
v-html="credit"
|
|
74
75
|
></li>
|
|
75
76
|
</ul>
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
</div>
|
|
80
81
|
</template>
|
|
81
82
|
<script>
|
|
82
|
-
import {
|
|
83
|
+
import { mapActions } from 'pinia'
|
|
83
84
|
import { useAppStore } from '../module/stores/appStore'
|
|
84
85
|
import { validateObjType } from '../shared/validators'
|
|
85
86
|
import { useI18n } from 'vue-i18n'
|
|
@@ -99,17 +100,17 @@ export default {
|
|
|
99
100
|
shouldDeactivate: false,
|
|
100
101
|
errorData: [],
|
|
101
102
|
notes: null,
|
|
102
|
-
credits: null
|
|
103
|
+
credits: null,
|
|
104
|
+
test: null
|
|
103
105
|
}
|
|
104
106
|
},
|
|
105
107
|
computed: {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
])
|
|
108
|
+
hasNotes() {
|
|
109
|
+
return this.notes && this.notes.length
|
|
110
|
+
},
|
|
111
|
+
hasCredits() {
|
|
112
|
+
return this.credits && this.credits.length
|
|
113
|
+
}
|
|
113
114
|
},
|
|
114
115
|
created() {},
|
|
115
116
|
beforeUnmount() {
|
|
@@ -150,7 +151,6 @@ export default {
|
|
|
150
151
|
//Add all the note to the temp array
|
|
151
152
|
formatedNotes.push(...Object.values(g)[0])
|
|
152
153
|
})
|
|
153
|
-
|
|
154
154
|
return formatedNotes
|
|
155
155
|
},
|
|
156
156
|
|
|
@@ -168,6 +168,7 @@ export default {
|
|
|
168
168
|
},
|
|
169
169
|
setPageNotesAndCredits(data) {
|
|
170
170
|
const { notes, credits } = data
|
|
171
|
+
|
|
171
172
|
this.notes = this.getPageNotes(notes)
|
|
172
173
|
this.credits = this.getPageCredits(credits)
|
|
173
174
|
},
|
|
@@ -180,7 +181,6 @@ export default {
|
|
|
180
181
|
validateData(ctx, data) {
|
|
181
182
|
let errConsole = []
|
|
182
183
|
if (this.errorData.length) this.errorData = [] //reset the error tracker
|
|
183
|
-
|
|
184
184
|
switch (ctx) {
|
|
185
185
|
case 'note': {
|
|
186
186
|
if (data.constructor !== Object) {
|
|
@@ -191,7 +191,6 @@ export default {
|
|
|
191
191
|
`Unexpected definition the note. Expecting Object but received ${typeof data}`
|
|
192
192
|
)
|
|
193
193
|
}
|
|
194
|
-
|
|
195
194
|
let stringType = ['id', 'text'] //expected attribute in the note declaration
|
|
196
195
|
|
|
197
196
|
let { errorInConsole, errorList } = validateObjType(
|
|
@@ -202,7 +201,6 @@ export default {
|
|
|
202
201
|
null,
|
|
203
202
|
`Note ${data.details}`
|
|
204
203
|
)
|
|
205
|
-
|
|
206
204
|
if (errorInConsole.length) errConsole.push(...errorInConsole)
|
|
207
205
|
if (errorList.length) this.errorData.push(...errorList)
|
|
208
206
|
break
|
|
@@ -353,6 +351,10 @@ export default {
|
|
|
353
351
|
const elTarget = widgetContent.namedItem(ref) // Target current button
|
|
354
352
|
const pageRef = elTarget.getAttribute('pageref')
|
|
355
353
|
|
|
354
|
+
console.log('widgetContent :', widgetContent)
|
|
355
|
+
console.log('elTarget :', elTarget)
|
|
356
|
+
console.log('pageRef :', pageRef)
|
|
357
|
+
|
|
356
358
|
if (!this.sideBarIsOpen) this.prevNote = null //reset previous when sidebar is opened
|
|
357
359
|
|
|
358
360
|
let prevPageref = this.prevNote
|
|
@@ -414,10 +416,6 @@ export default {
|
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
418
|
|
|
417
|
-
// .note-txt {
|
|
418
|
-
// pointer-events: none;
|
|
419
|
-
// }
|
|
420
|
-
|
|
421
419
|
.box-nc {
|
|
422
420
|
margin-top: 54px;
|
|
423
421
|
overflow-y: auto;
|
|
@@ -460,6 +460,7 @@ export default {
|
|
|
460
460
|
const timer = reactive(new Timer(id)) // Making Timer instance reactive to be able to track changes
|
|
461
461
|
const { t } = useI18n()
|
|
462
462
|
return { id, store, timer, t }
|
|
463
|
+
//return { id, store, timer }
|
|
463
464
|
},
|
|
464
465
|
data() {
|
|
465
466
|
return {
|
|
@@ -913,7 +914,7 @@ export default {
|
|
|
913
914
|
* @description - handle all the listeners for medias
|
|
914
915
|
*/
|
|
915
916
|
setMediaHandlers() {
|
|
916
|
-
if (this.mediaElement) {
|
|
917
|
+
if (this.mediaElement && this.mediaElement.addEventListener) {
|
|
917
918
|
//Prevent default on keys used for navigation in the player (prevent scrollbar to be trigger when changing volume)
|
|
918
919
|
this.pbContainer.addEventListener('keydown', this.keysPreventDefault)
|
|
919
920
|
//progressBar events
|
|
@@ -921,7 +922,7 @@ export default {
|
|
|
921
922
|
//window handlers for playbar progress
|
|
922
923
|
window.addEventListener('mousemove', this.progressWindowMove)
|
|
923
924
|
window.addEventListener('mouseup', this.progressWindowUp)
|
|
924
|
-
|
|
925
|
+
// console.log('⚠️--- TEST AppCompPlayBarNext---', this.mediaElement)
|
|
925
926
|
//Update data when media as a timeupdate/ended
|
|
926
927
|
this.mediaElement.addEventListener(
|
|
927
928
|
'timeupdate',
|
|
@@ -1580,7 +1581,10 @@ export default {
|
|
|
1580
1581
|
*/
|
|
1581
1582
|
setVideoHandlers() {
|
|
1582
1583
|
//Tooltip
|
|
1584
|
+
if (!this.progressArea || !this.progressArea.addEventListener) return
|
|
1583
1585
|
this.progressArea.addEventListener('mousemove', this.updateSeekTooltip)
|
|
1586
|
+
|
|
1587
|
+
if (!this.mediaContainer || !this.mediaContainer.addEventListener) return
|
|
1584
1588
|
//Fullscreen
|
|
1585
1589
|
this.mediaContainer.addEventListener(
|
|
1586
1590
|
'fullscreenchange',
|
|
@@ -1594,7 +1598,10 @@ export default {
|
|
|
1594
1598
|
*/
|
|
1595
1599
|
removeVideoHandlers() {
|
|
1596
1600
|
//Tooltip
|
|
1601
|
+
if (!this.progressArea || !this.progressArea.addEventListener) return
|
|
1597
1602
|
this.progressArea.removeEventListener('mousemove', this.updateSeekTooltip)
|
|
1603
|
+
if (!this.mediaContainer || !this.mediaContainer.removeEventListener)
|
|
1604
|
+
return
|
|
1598
1605
|
//Fullscreen
|
|
1599
1606
|
this.mediaContainer.removeEventListener(
|
|
1600
1607
|
'fullscreenchange',
|
|
@@ -1777,7 +1784,8 @@ export default {
|
|
|
1777
1784
|
*/
|
|
1778
1785
|
|
|
1779
1786
|
hideControls() {
|
|
1780
|
-
|
|
1787
|
+
//Always show playbar when paused or not in fullscreen mode
|
|
1788
|
+
if (this.mediaElement.paused || !document.fullscreenElement) return
|
|
1781
1789
|
|
|
1782
1790
|
this.hideTimer = setTimeout(() => {
|
|
1783
1791
|
this.showControlsValue = false
|
|
@@ -103,27 +103,15 @@ export default {
|
|
|
103
103
|
//Watch for user interaction change to get quizRecall answer
|
|
104
104
|
getUserInteraction: {
|
|
105
105
|
async handler(newValue) {
|
|
106
|
-
//console.log('???')
|
|
107
106
|
if (!this.getUserInteraction) return
|
|
108
|
-
//console.log('--------------------')
|
|
109
107
|
const { activityId, pageId } = this.quizRecallData
|
|
110
108
|
const interaction = this.getPageInteraction(
|
|
111
109
|
activityId,
|
|
112
110
|
pageId
|
|
113
111
|
).userInteraction
|
|
114
|
-
|
|
115
|
-
//console.log(interaction)
|
|
116
|
-
if (!interaction) return //{
|
|
117
|
-
// this.quizRecall.done == false
|
|
118
|
-
// }
|
|
119
|
-
|
|
120
112
|
//Get quizRecall answer
|
|
121
113
|
if (this.quizRecallData && this.quizData) {
|
|
122
|
-
//console.log('ici????')
|
|
123
114
|
await this.getQuizRecallAnswer(interaction)
|
|
124
|
-
} else {
|
|
125
|
-
//console.log('laaaaaa ???? ')
|
|
126
|
-
this.quizRecall.done == false
|
|
127
115
|
}
|
|
128
116
|
},
|
|
129
117
|
immediate: true,
|
|
@@ -216,6 +204,13 @@ export default {
|
|
|
216
204
|
//Get datas from quizRecallData and userData and add them to quizRecall object
|
|
217
205
|
async getQuizRecallAnswer(userData) {
|
|
218
206
|
await this.$nextTick() //wait for the DOM to update
|
|
207
|
+
//userData will be undefined if the page containing the target quiz was never visited
|
|
208
|
+
if (typeof userData === 'undefined') {
|
|
209
|
+
this.quizRecall.done = false //set quiz recall message (quiz not completed)
|
|
210
|
+
this.isReady = true //hide the skeleton
|
|
211
|
+
return
|
|
212
|
+
}
|
|
213
|
+
|
|
219
214
|
const { quizId, hypertext_done, hypertext_undone, title, titletag } =
|
|
220
215
|
this.quizRecallData
|
|
221
216
|
|
|
@@ -252,7 +247,6 @@ export default {
|
|
|
252
247
|
this.quizRecall.answer = quizAnswer.value[0].filled || ''
|
|
253
248
|
this.quizRecall.ennonce = this.quizData.ennonce
|
|
254
249
|
}
|
|
255
|
-
this.quizRecall
|
|
256
250
|
this.isReady = true //Set isReady to true to display the component
|
|
257
251
|
},
|
|
258
252
|
|
package/src/main.js
CHANGED
|
@@ -489,8 +489,9 @@ export default {
|
|
|
489
489
|
|
|
490
490
|
appStore.applicationSettings = settingsOptions
|
|
491
491
|
//=================================END SETTING PREFERENCES ====================================//
|
|
492
|
-
|
|
493
|
-
|
|
492
|
+
// const appi18b = options.i18n
|
|
493
|
+
// console.log('i18n options received in appBase plugin...', appi18b)
|
|
494
|
+
const i18n = initLocalisation(options.i18n)
|
|
494
495
|
app.use(i18n)
|
|
495
496
|
app.use(helper)
|
|
496
497
|
app.use(analytics)
|
|
@@ -27,7 +27,6 @@ export const useAppStore = defineStore('$appStore', {
|
|
|
27
27
|
userMetaData: {},
|
|
28
28
|
appConfigs: null,
|
|
29
29
|
menuSetting: null,
|
|
30
|
-
dataNc: {},
|
|
31
30
|
wigIsOpen: false,
|
|
32
31
|
popIsOpen: false,
|
|
33
32
|
sideBIsOpen: false,
|
|
@@ -596,9 +595,6 @@ export const useAppStore = defineStore('$appStore', {
|
|
|
596
595
|
getDataFromServer: (state) => {
|
|
597
596
|
return state.dataFromServer
|
|
598
597
|
},
|
|
599
|
-
getDataNoteCredit: (state) => {
|
|
600
|
-
return state.dataNc
|
|
601
|
-
},
|
|
602
598
|
getWidgetOpen(state) {
|
|
603
599
|
return state.wigIsOpen
|
|
604
600
|
},
|
|
@@ -801,9 +797,6 @@ export const useAppStore = defineStore('$appStore', {
|
|
|
801
797
|
)
|
|
802
798
|
this.currentSection = data
|
|
803
799
|
},
|
|
804
|
-
updateCurrentnoteCredit(data) {
|
|
805
|
-
this.dataNc = data
|
|
806
|
-
},
|
|
807
800
|
/**
|
|
808
801
|
* @description: Save user interaction on a page to store
|
|
809
802
|
* USe to Update existing userMetadata
|
package/src/plugins/i18n.js
CHANGED
|
@@ -7,7 +7,6 @@ import { createI18n } from 'vue-i18n'
|
|
|
7
7
|
*/
|
|
8
8
|
export default function initLocalisation(templateMessages) {
|
|
9
9
|
const i18n = createI18n({ legacy: false })
|
|
10
|
-
|
|
11
10
|
const thisLocales = import.meta.glob('../$locales/*.json', {
|
|
12
11
|
import: 'default',
|
|
13
12
|
eager: true
|
|
@@ -18,7 +17,7 @@ export default function initLocalisation(templateMessages) {
|
|
|
18
17
|
const locale = matched[1]
|
|
19
18
|
// Using lodash to deeply merge objects
|
|
20
19
|
const coreMessages = JSON.parse(JSON.stringify(thisLocales[path]))
|
|
21
|
-
const mergedMessages = _.merge(coreMessages, templateMessages)
|
|
20
|
+
const mergedMessages = _.merge(coreMessages, templateMessages[locale])
|
|
22
21
|
|
|
23
22
|
// Since merLocalMessage will do a shallow merge of the object. We will use setLocalMessage to replace the message with new message object
|
|
24
23
|
|
package/src/shared/validators.js
CHANGED
|
@@ -955,18 +955,9 @@ const validateQuizData = (data) => {
|
|
|
955
955
|
if (hasError) return errors
|
|
956
956
|
|
|
957
957
|
//validate Containt for retroaction
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
// if(data.solution !=null){
|
|
961
|
-
// console.log('ici')
|
|
962
|
-
// }else{
|
|
963
|
-
// console.log('la')
|
|
964
|
-
// }
|
|
965
|
-
|
|
966
958
|
switch (true) {
|
|
967
959
|
case data.retroaction != null:
|
|
968
960
|
objectType = ['retro_positive', 'retro_negative', 'retro_neutre']
|
|
969
|
-
|
|
970
961
|
|
|
971
962
|
errors = validateObjType(
|
|
972
963
|
data.retroaction,
|
|
@@ -983,19 +974,15 @@ const validateQuizData = (data) => {
|
|
|
983
974
|
// Validate containt of retroaction attributes
|
|
984
975
|
stringType = ['title', 'hypertext']
|
|
985
976
|
|
|
986
|
-
|
|
987
977
|
for (const key of Object.keys(data.retroaction)) {
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
null,
|
|
997
|
-
key
|
|
998
|
-
)
|
|
978
|
+
if (key == 'retro_neutre') continue //skip
|
|
979
|
+
|
|
980
|
+
errors = validateObjType(
|
|
981
|
+
data.retroaction[key],
|
|
982
|
+
{ stringType },
|
|
983
|
+
null,
|
|
984
|
+
key
|
|
985
|
+
)
|
|
999
986
|
|
|
1000
987
|
hasError = errors.errorInConsole.length || errors.errorList.length
|
|
1001
988
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils'
|
|
2
|
-
import { describe, it, test, expect } from 'vitest'
|
|
2
|
+
import { describe, it, test, expect, vi } from 'vitest'
|
|
3
|
+
|
|
4
|
+
//Mock store appStore
|
|
5
|
+
vi.mock('@/module/stores/appStore', () => ({
|
|
6
|
+
useAppStore: () => ({})
|
|
7
|
+
}))
|
|
3
8
|
|
|
4
9
|
let dummyProps = {
|
|
5
10
|
id: 'P01',
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
3
|
+
import { createTestingPinia } from '@pinia/testing'
|
|
4
|
+
import { colors } from '../utility/colors'
|
|
5
|
+
|
|
6
|
+
//Mock store appStore
|
|
7
|
+
vi.mock('@/module/stores/appStore', () => ({
|
|
8
|
+
useAppStore: () => ({
|
|
9
|
+
getAllCompleted: { A01: [] }
|
|
10
|
+
})
|
|
11
|
+
}))
|
|
12
|
+
|
|
13
|
+
import AppCompBranchButtons from '@/components/AppCompBranchButtons.vue'
|
|
14
|
+
|
|
15
|
+
const dummyProps = {
|
|
16
|
+
cards: [
|
|
17
|
+
{
|
|
18
|
+
imgFile: 'https://loremflickr.com/500/500/kitten',
|
|
19
|
+
imgAlt: 'Test img 1',
|
|
20
|
+
title: 'banane',
|
|
21
|
+
text: 'Ceci est un embranchement factice, affiché sous la forme de carte.',
|
|
22
|
+
brchName: 'P02_E01'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
imgFile: 'https://loremflickr.com/500/500/kitten',
|
|
26
|
+
imgAlt: 'Test img 2',
|
|
27
|
+
title: 'Titre embranchement 2',
|
|
28
|
+
text: 'Ceci est un embranchement factice, affiché sous la forme de carte, pour toto',
|
|
29
|
+
brchName: 'P02_E02'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
imgFile: 'https://loremflickr.com/500/500/kitten',
|
|
33
|
+
imgAlt: 'Test img 3',
|
|
34
|
+
title: 'Titre embranchement 3',
|
|
35
|
+
text: 'Ceci est un embranchement factice, affiché sous la forme de carte, pour toto',
|
|
36
|
+
brchName: 'P02_E03'
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
customButtons: [
|
|
40
|
+
{ name: 'bouton_A02_P01_E01', brchName: 'P02_E01' },
|
|
41
|
+
{ name: 'bouton_A02_P01_E02', brchName: 'P02_E02' }
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
describe('AppCompBranchButtons.vue', () => {
|
|
46
|
+
let globalConfig
|
|
47
|
+
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
globalConfig = {
|
|
50
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })],
|
|
51
|
+
mocks: {
|
|
52
|
+
$router: {
|
|
53
|
+
currentRoute: {
|
|
54
|
+
value: {
|
|
55
|
+
meta: {
|
|
56
|
+
activity_ref: 'A01',
|
|
57
|
+
children: [
|
|
58
|
+
{
|
|
59
|
+
_ref: 'P02_E01',
|
|
60
|
+
_path: 'branche-1',
|
|
61
|
+
_namedRoute: 'activite_3.page_2.branche_1'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
_ref: 'P02_E02',
|
|
65
|
+
_path: 'branche-2',
|
|
66
|
+
_namedRoute: 'activite_3.page_2.branche_2'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
_ref: 'P02_E03',
|
|
70
|
+
_path: 'branche-3',
|
|
71
|
+
_namedRoute: 'activite_3.page_2.branche_3'
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
vi.clearAllMocks()
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('Renders ErrorDisplay when cards has errors', async () => {
|
|
84
|
+
const wrapper = mount(AppCompBranchButtons, {
|
|
85
|
+
global: globalConfig,
|
|
86
|
+
props: {
|
|
87
|
+
cards: [dummyProps.cards[0], dummyProps.cards[1]] // Only 2 cards passed instead of 3
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
await wrapper.vm.$nextTick() // Must wait for DOM updates to display AppBaseErrorDisplay
|
|
92
|
+
|
|
93
|
+
if (wrapper.vm.hasErrors) {
|
|
94
|
+
const cards = wrapper.vm.cards
|
|
95
|
+
console.log(colors.green, `\n ✅ Current cards: ${JSON.stringify(cards)}`)
|
|
96
|
+
console.log(
|
|
97
|
+
'✅ wrapper.vm.hasErrors:',
|
|
98
|
+
wrapper.vm.hasErrors,
|
|
99
|
+
colors.reset
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
// Error should be displayed
|
|
103
|
+
expect(wrapper.vm.hasErrors.length).toBeGreaterThan(0)
|
|
104
|
+
expect(
|
|
105
|
+
wrapper.findComponent({ name: 'AppBaseErrorDisplay' }).exists()
|
|
106
|
+
).toBe(true)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('Renders ErrorDisplay when customButtons has errors', async () => {
|
|
110
|
+
const wrapper = mount(AppCompBranchButtons, {
|
|
111
|
+
global: globalConfig,
|
|
112
|
+
props: {
|
|
113
|
+
customButtons: [
|
|
114
|
+
{ brchName: 'BRANCH_1' }, // missing required key 'name' here
|
|
115
|
+
{ name: 'bouton_A02_P01_E01', brchName: 'P02_E02' },
|
|
116
|
+
{ name: 'bouton_A02_P01_E01', brchName: 'P02_E03' }
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
await wrapper.vm.$nextTick() // Must wait for DOM updates to display AppBaseErrorDisplay
|
|
121
|
+
|
|
122
|
+
if (wrapper.vm.hasErrors) {
|
|
123
|
+
const el = wrapper.vm.customButtons[0]
|
|
124
|
+
console.log(colors.green, `\n ✅ Current cards: ${JSON.stringify(el)}`)
|
|
125
|
+
console.log(
|
|
126
|
+
'✅ wrapper.vm.hasErrors:',
|
|
127
|
+
wrapper.vm.hasErrors,
|
|
128
|
+
colors.reset
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
// hasError should have a message
|
|
132
|
+
expect(wrapper.vm.hasErrors.length).toBeGreaterThan(0)
|
|
133
|
+
// Error should be displayed
|
|
134
|
+
expect(
|
|
135
|
+
wrapper.findComponent({ name: 'AppBaseErrorDisplay' }).exists()
|
|
136
|
+
).toBe(true)
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
//=====================================================================
|
|
140
|
+
it('It renders the buttons when no errors', async () => {
|
|
141
|
+
const wrapper = mount(AppCompBranchButtons, {
|
|
142
|
+
global: {
|
|
143
|
+
...globalConfig
|
|
144
|
+
},
|
|
145
|
+
props: {
|
|
146
|
+
cards: dummyProps.cards
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
await wrapper.vm.$nextTick() // Must wait for DOM updates to display AppBaseErrorDisplay
|
|
151
|
+
|
|
152
|
+
if (wrapper.vm.hasErrors) {
|
|
153
|
+
console.log(colors.red)
|
|
154
|
+
console.log(
|
|
155
|
+
'\n wrapper.vm.hasErrors:',
|
|
156
|
+
wrapper.vm.hasErrors,
|
|
157
|
+
colors.reset
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// expect hasErrors to return false
|
|
162
|
+
expect(wrapper.vm.hasErrors).toBe(false)
|
|
163
|
+
//error display not to be in DOM
|
|
164
|
+
expect(
|
|
165
|
+
wrapper.findComponent({ name: 'AppBaseErrorDisplay' }).exists()
|
|
166
|
+
).not.toBe(true)
|
|
167
|
+
// element to rendered correctly in DOM
|
|
168
|
+
expect(wrapper.find('#branch-buttons-component').exists()).toBe(true)
|
|
169
|
+
//should display 3 buttons
|
|
170
|
+
expect(wrapper.findAll('.branch-btn').length).toBe(3)
|
|
171
|
+
})
|
|
172
|
+
})
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils'
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
3
|
+
|
|
4
|
+
//Mock store appStore
|
|
5
|
+
vi.mock('@/module/stores/appStore', () => ({
|
|
6
|
+
useAppStore: () => ({
|
|
7
|
+
getAppConfigs: { lang: 'FR' }
|
|
8
|
+
})
|
|
9
|
+
}))
|
|
5
10
|
|
|
6
11
|
const dummyProps = {
|
|
7
12
|
slides: [
|
|
@@ -28,6 +33,9 @@ const dummyProps = {
|
|
|
28
33
|
name: 'Mon super carousel'
|
|
29
34
|
}
|
|
30
35
|
|
|
36
|
+
import AppCompCarousel from '@/components/AppCompCarousel.vue'
|
|
37
|
+
import AppBaseButton from '@/components/AppBaseButton.vue'
|
|
38
|
+
|
|
31
39
|
describe('AppCompCarousel.vue', () => {
|
|
32
40
|
let wrapper = null
|
|
33
41
|
beforeEach(() => {
|