@windward/games 0.0.4 → 0.0.6
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/components/content/DatableEditor.vue +0 -3
- package/components/content/blocks/crosswordPuzzle/Crossword.ts +231 -153
- package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +91 -0
- package/components/content/blocks/crosswordPuzzle/CrosswordElements.ts +8 -6
- package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +502 -371
- package/components/content/blocks/matchingGame/MatchingGame.vue +12 -1
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +187 -127
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +37 -13
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +368 -0
- package/components/content/blocks/sevenStrikes/keyboard.vue +71 -0
- package/components/content/blocks/wordJumble/Jumble.vue +2 -10
- package/components/settings/CrosswordPuzzleSettingsManager.vue +12 -15
- package/components/settings/MatchingGameManager.vue +1 -1
- package/components/settings/MultipleChoiceSettingsManager.vue +21 -7
- package/components/settings/SevenStrikesSettingsManager.vue +288 -0
- package/i18n/en-US/components/content/blocks/crossword.ts +18 -3
- package/i18n/en-US/components/content/blocks/index.ts +2 -0
- package/i18n/en-US/components/content/blocks/multiple_choice.ts +2 -4
- package/i18n/en-US/components/content/blocks/seven_strikes.ts +6 -0
- package/i18n/en-US/components/settings/crossword.ts +2 -1
- package/i18n/en-US/components/settings/index.ts +2 -0
- package/i18n/en-US/components/settings/multiple_choice.ts +1 -1
- package/i18n/en-US/components/settings/seven_strikes.ts +8 -0
- package/i18n/en-US/shared/content_blocks.ts +1 -0
- package/i18n/en-US/shared/settings.ts +1 -0
- package/package.json +2 -1
- package/plugin.js +21 -0
- package/test/blocks/sevenStrikes/sevenStrikes.spec.js +24 -0
- package/test/settings/SevenStrikesManager.spec.js +53 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-text-field
|
|
4
|
+
v-model="block.metadata.config.title"
|
|
5
|
+
:counter="50"
|
|
6
|
+
:label="
|
|
7
|
+
$t('plugin.games.components.settings.bucket_game.form.title')
|
|
8
|
+
"
|
|
9
|
+
ref="title"
|
|
10
|
+
></v-text-field>
|
|
11
|
+
<br />
|
|
12
|
+
<v-textarea
|
|
13
|
+
outlined
|
|
14
|
+
auto-grow
|
|
15
|
+
v-model="block.metadata.config.instructions"
|
|
16
|
+
:label="
|
|
17
|
+
$t(
|
|
18
|
+
'plugin.games.components.settings.bucket_game.form.instructions'
|
|
19
|
+
)
|
|
20
|
+
"
|
|
21
|
+
></v-textarea>
|
|
22
|
+
<v-expansion-panels flat>
|
|
23
|
+
<v-expansion-panel>
|
|
24
|
+
<v-expansion-panel-header class="pa-0">
|
|
25
|
+
<h3>
|
|
26
|
+
{{
|
|
27
|
+
$t(
|
|
28
|
+
'plugin.games.components.settings.seven_strikes.items'
|
|
29
|
+
)
|
|
30
|
+
}}
|
|
31
|
+
</h3>
|
|
32
|
+
</v-expansion-panel-header>
|
|
33
|
+
<v-expansion-panel-content class="ma-0">
|
|
34
|
+
<v-card
|
|
35
|
+
v-for="(item, index) in block.metadata.config.words"
|
|
36
|
+
:key="'bucket_' + index"
|
|
37
|
+
class="pa-2 flex-fill cardOutline"
|
|
38
|
+
elevation="0"
|
|
39
|
+
outlined
|
|
40
|
+
tile
|
|
41
|
+
>
|
|
42
|
+
<v-row class="itemHeight">
|
|
43
|
+
<p
|
|
44
|
+
class="text-truncate pa-0 ma-0 seventy"
|
|
45
|
+
@click="onOpenEditor(index)"
|
|
46
|
+
v-on:keyup.enter="onOpenEditor(index)"
|
|
47
|
+
@mouseover="onHover"
|
|
48
|
+
@mouseleave="onHoverLeave"
|
|
49
|
+
:class="cursor"
|
|
50
|
+
tabindex="0"
|
|
51
|
+
>
|
|
52
|
+
<v-icon class="pl-2"
|
|
53
|
+
>mdi-gesture-tap-hold</v-icon
|
|
54
|
+
>
|
|
55
|
+
{{
|
|
56
|
+
item.value
|
|
57
|
+
? block.metadata.config.words[index]
|
|
58
|
+
.value
|
|
59
|
+
: $t(
|
|
60
|
+
'plugin.games.components.settings.bucket_game.form.enter_text'
|
|
61
|
+
)
|
|
62
|
+
}}
|
|
63
|
+
</p>
|
|
64
|
+
<v-icon class="twenty" @click="onDelete(index)"
|
|
65
|
+
>mdi-delete-outline</v-icon
|
|
66
|
+
>
|
|
67
|
+
</v-row>
|
|
68
|
+
<v-textarea
|
|
69
|
+
v-if="item.expand"
|
|
70
|
+
outlined
|
|
71
|
+
:autofocus="true"
|
|
72
|
+
:label="
|
|
73
|
+
$t(
|
|
74
|
+
'plugin.games.components.settings.seven_strikes.word'
|
|
75
|
+
)
|
|
76
|
+
"
|
|
77
|
+
class="pt-4"
|
|
78
|
+
v-model="block.metadata.config.words[index].value"
|
|
79
|
+
></v-textarea>
|
|
80
|
+
<v-textarea
|
|
81
|
+
v-if="item.expand"
|
|
82
|
+
outlined
|
|
83
|
+
class="pt-4"
|
|
84
|
+
:label="
|
|
85
|
+
$t(
|
|
86
|
+
'plugin.games.components.settings.seven_strikes.hint'
|
|
87
|
+
)
|
|
88
|
+
"
|
|
89
|
+
v-model="block.metadata.config.words[index].hint"
|
|
90
|
+
></v-textarea>
|
|
91
|
+
</v-card>
|
|
92
|
+
<p
|
|
93
|
+
@mouseover="onHover"
|
|
94
|
+
@mouseleave="onHoverLeave"
|
|
95
|
+
@click="onAddElement"
|
|
96
|
+
v-on:keyup.enter="onAddElement"
|
|
97
|
+
class="fullWidth"
|
|
98
|
+
:class="cursor"
|
|
99
|
+
tabindex="0"
|
|
100
|
+
>
|
|
101
|
+
<v-icon class="primary addIcon">mdi-plus</v-icon>
|
|
102
|
+
{{
|
|
103
|
+
$t(
|
|
104
|
+
'plugin.games.components.content.blocks.sorting_game.add_element'
|
|
105
|
+
)
|
|
106
|
+
}}
|
|
107
|
+
</p>
|
|
108
|
+
</v-expansion-panel-content>
|
|
109
|
+
</v-expansion-panel>
|
|
110
|
+
</v-expansion-panels>
|
|
111
|
+
<v-row class="mt-3">
|
|
112
|
+
<v-textarea
|
|
113
|
+
v-model="block.metadata.config.feedback_correct"
|
|
114
|
+
outlined
|
|
115
|
+
auto-grow
|
|
116
|
+
:counter="50"
|
|
117
|
+
:label="
|
|
118
|
+
$t(
|
|
119
|
+
'plugin.games.components.settings.word_jumble.feedback_correct'
|
|
120
|
+
)
|
|
121
|
+
"
|
|
122
|
+
ref="title"
|
|
123
|
+
></v-textarea>
|
|
124
|
+
<br />
|
|
125
|
+
<v-textarea
|
|
126
|
+
outlined
|
|
127
|
+
auto-grow
|
|
128
|
+
v-model="block.metadata.config.feedback_incorrect"
|
|
129
|
+
:label="
|
|
130
|
+
$t(
|
|
131
|
+
'plugin.games.components.settings.word_jumble.feedback_incorrect'
|
|
132
|
+
)
|
|
133
|
+
"
|
|
134
|
+
></v-textarea>
|
|
135
|
+
<br />
|
|
136
|
+
</v-row>
|
|
137
|
+
</div>
|
|
138
|
+
</template>
|
|
139
|
+
|
|
140
|
+
<script>
|
|
141
|
+
import _ from 'lodash'
|
|
142
|
+
import draggable from 'vuedraggable'
|
|
143
|
+
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
144
|
+
import CrudTable from '../content/CrudTable.vue'
|
|
145
|
+
|
|
146
|
+
export default {
|
|
147
|
+
name: 'SevenStrikesSettingsManager',
|
|
148
|
+
extends: BaseContentSettings,
|
|
149
|
+
components: { CrudTable, draggable },
|
|
150
|
+
beforeMount() {
|
|
151
|
+
if (_.isEmpty(this.block)) {
|
|
152
|
+
this.block = {}
|
|
153
|
+
}
|
|
154
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
155
|
+
this.block.metadata = {}
|
|
156
|
+
}
|
|
157
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
158
|
+
this.block.metadata.config = {}
|
|
159
|
+
}
|
|
160
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
161
|
+
this.block.metadata.config.title = ''
|
|
162
|
+
}
|
|
163
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
164
|
+
this.block.metadata.config.instructions = this.$t(
|
|
165
|
+
'plugin.games.components.settings.seven_strikes.instructions'
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
169
|
+
this.block.metadata.config.feedback_correct = ''
|
|
170
|
+
}
|
|
171
|
+
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
172
|
+
this.block.metadata.config.feedback_incorrect = ''
|
|
173
|
+
}
|
|
174
|
+
if (_.isEmpty(this.block.metadata.config.words)) {
|
|
175
|
+
this.block.metadata.config.words = []
|
|
176
|
+
const default_object = {
|
|
177
|
+
value: '',
|
|
178
|
+
expand: true,
|
|
179
|
+
hint: '',
|
|
180
|
+
splitWord: '',
|
|
181
|
+
}
|
|
182
|
+
this.block.metadata.config.words.push(default_object)
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
data() {
|
|
186
|
+
return {
|
|
187
|
+
cursor: null,
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
methods: {
|
|
191
|
+
onBeforeSave() {
|
|
192
|
+
this.block.metadata.config.words.forEach((element) => {
|
|
193
|
+
// check against lowercase keyboard inputs
|
|
194
|
+
element.value = element.value.toLowerCase()
|
|
195
|
+
element.splitWord = element.value.split('')
|
|
196
|
+
element.splitWord.forEach((letter) => {
|
|
197
|
+
const letterIndex = element.splitWord.indexOf(letter)
|
|
198
|
+
element.splitWord[letterIndex] = {
|
|
199
|
+
letter: letter,
|
|
200
|
+
show: false,
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
},
|
|
205
|
+
onAddElement() {
|
|
206
|
+
this.block.metadata.config.words.forEach((element) => {
|
|
207
|
+
element.expand = false
|
|
208
|
+
})
|
|
209
|
+
const default_object = {
|
|
210
|
+
value: '',
|
|
211
|
+
expand: true,
|
|
212
|
+
hint: '',
|
|
213
|
+
splitWord: '',
|
|
214
|
+
}
|
|
215
|
+
this.block.metadata.config.words.push(default_object)
|
|
216
|
+
},
|
|
217
|
+
onHover(index) {
|
|
218
|
+
this.cursor = 'changePointer'
|
|
219
|
+
},
|
|
220
|
+
onHoverLeave() {
|
|
221
|
+
this.cursor = ''
|
|
222
|
+
},
|
|
223
|
+
onOpenEditor(index) {
|
|
224
|
+
// open target element
|
|
225
|
+
this.block.metadata.config.words[index].expand =
|
|
226
|
+
!this.block.metadata.config.words[index].expand
|
|
227
|
+
// close all other expanded areas
|
|
228
|
+
this.block.metadata.config.words.forEach((element) => {
|
|
229
|
+
let indexOf = this.block.metadata.config.words.indexOf(element)
|
|
230
|
+
if (index !== indexOf) {
|
|
231
|
+
element.expand = false
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
},
|
|
235
|
+
onDelete(index) {
|
|
236
|
+
this.block.metadata.config.words.splice(index, 1)
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
}
|
|
240
|
+
</script>
|
|
241
|
+
|
|
242
|
+
<style lang="scss" scoped>
|
|
243
|
+
.v-progress-circular {
|
|
244
|
+
margin: 1rem;
|
|
245
|
+
}
|
|
246
|
+
.cardOutline {
|
|
247
|
+
border: 2px solid var(--v-primary-base);
|
|
248
|
+
margin-bottom: 8px;
|
|
249
|
+
}
|
|
250
|
+
.fullWidth {
|
|
251
|
+
display: flex;
|
|
252
|
+
justify-content: center;
|
|
253
|
+
align-items: center;
|
|
254
|
+
font-weight: bold;
|
|
255
|
+
font-size: 16px;
|
|
256
|
+
}
|
|
257
|
+
.itemHeight {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-content: center;
|
|
260
|
+
justify-content: space-between;
|
|
261
|
+
height: 60px;
|
|
262
|
+
}
|
|
263
|
+
.changePointer {
|
|
264
|
+
cursor: pointer !important;
|
|
265
|
+
}
|
|
266
|
+
.seventy {
|
|
267
|
+
width: 70%;
|
|
268
|
+
height: 100%;
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
}
|
|
272
|
+
.twenty {
|
|
273
|
+
width: 20%;
|
|
274
|
+
height: 90%;
|
|
275
|
+
margin-top: 3px;
|
|
276
|
+
border-left: 2px solid var(--v-primary-base);
|
|
277
|
+
}
|
|
278
|
+
.addButton {
|
|
279
|
+
height: 50%;
|
|
280
|
+
width: 50%;
|
|
281
|
+
}
|
|
282
|
+
.addIcon {
|
|
283
|
+
margin-right: 5px;
|
|
284
|
+
}
|
|
285
|
+
.v-expansion-panel-content::v-deep .v-expansion-panel-content__wrap {
|
|
286
|
+
padding: 0 !important;
|
|
287
|
+
}
|
|
288
|
+
</style>
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
crossword: 'Crossword Game',
|
|
3
3
|
add_element: 'Add Element',
|
|
4
|
-
|
|
5
|
-
'
|
|
6
|
-
|
|
4
|
+
initial_setup:
|
|
5
|
+
'Enter at least two words with clues to generate a crossword',
|
|
6
|
+
validation_error:
|
|
7
|
+
'The crossword could not be loaded because of the below error.',
|
|
8
|
+
error: {
|
|
9
|
+
min_words: 'You must enter at least two words with clues!',
|
|
10
|
+
words_no_shared_letters:
|
|
11
|
+
'The following words do not share letters: {0}',
|
|
12
|
+
word_length_max_limit: 'Cannot use words over 20 characters long.',
|
|
13
|
+
word_length_min_limit: 'Cannot use words under 2 characters long.',
|
|
14
|
+
could_not_generate:
|
|
15
|
+
'Could not generate a {0} by {0} crossword with the supplied words',
|
|
16
|
+
unknown: 'An unknown error occurred during the crossword creation',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
play_again: 'Randomize Crossword and Play Again',
|
|
20
|
+
across: 'Across',
|
|
21
|
+
down: 'Down',
|
|
7
22
|
}
|
|
@@ -6,6 +6,7 @@ import quizshow_game from './quizshow_game'
|
|
|
6
6
|
import slideshow from './slideshow'
|
|
7
7
|
import multiple_choice from './multiple_choice'
|
|
8
8
|
import word_jumble from './word_jumble'
|
|
9
|
+
import seven_strikes from './seven_strikes'
|
|
9
10
|
import crossword from './crossword'
|
|
10
11
|
|
|
11
12
|
export default {
|
|
@@ -17,5 +18,6 @@ export default {
|
|
|
17
18
|
slideshow,
|
|
18
19
|
multiple_choice,
|
|
19
20
|
word_jumble,
|
|
21
|
+
seven_strikes,
|
|
20
22
|
crossword,
|
|
21
23
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
game_title: 'Multiple Choice Game',
|
|
3
|
-
hint: 'View
|
|
3
|
+
hint: 'View Hint',
|
|
4
4
|
fifty: '50:50',
|
|
5
|
-
print: 'View Print Version',
|
|
6
|
-
reset: 'Reset Game',
|
|
7
5
|
hint_title: 'Hint',
|
|
8
|
-
|
|
6
|
+
answer_feedback: 'Answer Feedback',
|
|
9
7
|
total_points: 'Total Points for Course',
|
|
10
8
|
out_of: ' out of ',
|
|
11
9
|
}
|
|
@@ -6,6 +6,7 @@ import slideshow from './slideshow'
|
|
|
6
6
|
import multiple_choice from './multiple_choice'
|
|
7
7
|
import sorting_game from './sorting_game'
|
|
8
8
|
import word_jumble from './word_jumble'
|
|
9
|
+
import seven_strikes from './seven_strikes'
|
|
9
10
|
import crossword from './crossword'
|
|
10
11
|
|
|
11
12
|
export default {
|
|
@@ -17,5 +18,6 @@ export default {
|
|
|
17
18
|
slideshow,
|
|
18
19
|
multiple_choice,
|
|
19
20
|
sorting_game,
|
|
21
|
+
seven_strikes,
|
|
20
22
|
crossword,
|
|
21
23
|
}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
questions: 'Questions',
|
|
6
6
|
modal_title: 'Multiple Choice Question',
|
|
7
7
|
question_hint: 'Question Hint',
|
|
8
|
-
|
|
8
|
+
answer_feedback: 'Answer Feedback',
|
|
9
9
|
question: 'Question',
|
|
10
10
|
answer_options: 'Answer Options',
|
|
11
11
|
answer_option: 'Answer Option',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Seven Strikes',
|
|
3
|
+
instructions:
|
|
4
|
+
'Read the clue below, and click on the letters to spell out the word the clue refers to. If you choose a letter that isnt in the word, an X will be illuminated. When you choose an incorrect letter 7 times, the game is over.Open a text-only version of this vocabulary game in a new windowSkip this vocabulary game',
|
|
5
|
+
word: 'Word or Phrase',
|
|
6
|
+
hint: 'Clue',
|
|
7
|
+
items: 'Items',
|
|
8
|
+
}
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
quizshow_manager: 'Quizshow Manager',
|
|
9
9
|
multiple_choice_manager: 'Multiple Choice Manager',
|
|
10
10
|
wordjumble_manager: 'Word Jumble Manager',
|
|
11
|
+
seven_strikes_manager: 'Seven Strikes Manager',
|
|
11
12
|
crossword_puzzle_manager: 'Crossword Puzzle Manager',
|
|
12
13
|
},
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windward/games",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Windward UI Plugin Games",
|
|
5
5
|
"main": "plugin.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"eslint": "^8.11.0",
|
|
21
21
|
"lodash": "^4.17.21",
|
|
22
22
|
"prettier": "^2.6.0",
|
|
23
|
+
"simple-keyboard": "^3.6.28",
|
|
23
24
|
"vue-excel-editor": "^1.5.19",
|
|
24
25
|
"vue-flashcard": "^1.1.6",
|
|
25
26
|
"vuedraggable": "^2.24.3"
|
package/plugin.js
CHANGED
|
@@ -3,6 +3,8 @@ import flashcards from './components/content/blocks/flashcards/FlashcardSlides'
|
|
|
3
3
|
import slideShow from './components/content/blocks/slideshow/SlideShow.vue'
|
|
4
4
|
import WordJumble from './components/content/blocks/wordJumble/WordJumble'
|
|
5
5
|
import WordJumbleSettings from './components/settings/WordJumbleSettingsManager.vue'
|
|
6
|
+
import SevenStrikes from './components/content/blocks/sevenStrikes/SevenStikes.vue'
|
|
7
|
+
import SevenStrikesSettingsManager from './components/settings/SevenStrikesSettingsManager.vue'
|
|
6
8
|
import FlashCardSlidesManager from './components/settings/FlashCardSlidesManager'
|
|
7
9
|
import SlideShowManager from './components/settings/SlideShowManager.vue'
|
|
8
10
|
import MatchingGameManager from './components/settings/MatchingGameManager.vue'
|
|
@@ -115,6 +117,16 @@ export default {
|
|
|
115
117
|
'plugin.games.shared.content_blocks.grouping.game',
|
|
116
118
|
},
|
|
117
119
|
},
|
|
120
|
+
{
|
|
121
|
+
tag: 'games-seven-strikes-game',
|
|
122
|
+
template: SevenStrikes,
|
|
123
|
+
metadata: {
|
|
124
|
+
icon: 'mdi-ab-testing',
|
|
125
|
+
name: 'plugin.games.shared.content_blocks.title.seven_strikes',
|
|
126
|
+
grouping:
|
|
127
|
+
'plugin.games.shared.content_blocks.grouping.game',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
118
130
|
{
|
|
119
131
|
tag: 'games-crossword-puzzle-game',
|
|
120
132
|
template: CrosswordPuzzle,
|
|
@@ -199,6 +211,15 @@ export default {
|
|
|
199
211
|
name: 'plugin.games.shared.settings.title.wordjumble_manager',
|
|
200
212
|
},
|
|
201
213
|
},
|
|
214
|
+
{
|
|
215
|
+
tag: 'games-seven-strikes-settings',
|
|
216
|
+
template: SevenStrikesSettingsManager,
|
|
217
|
+
context: ['block.games-seven-strikes-game'],
|
|
218
|
+
metadata: {
|
|
219
|
+
icon: 'mdi-cog',
|
|
220
|
+
name: 'plugin.games.shared.settings.title.seven_strikes_manager',
|
|
221
|
+
},
|
|
222
|
+
},
|
|
202
223
|
{
|
|
203
224
|
tag: 'games-crossword-puzzle-settings',
|
|
204
225
|
template: CrosswordPuzzleSettingsManager,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { defaultMocks } from '@windward/core/test/mocks'
|
|
3
|
+
import SevenStrikes from '@/components/content/blocks/sevenStrikes/SevenStikes'
|
|
4
|
+
|
|
5
|
+
import Vuetify from 'vuetify'
|
|
6
|
+
import Vue from 'vue'
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('SevenStrikesGame', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(SevenStrikes, {
|
|
12
|
+
propsData: {
|
|
13
|
+
value: {
|
|
14
|
+
id: '00000000-0000-0000-0000-000000000000',
|
|
15
|
+
name: 'Test Content Page',
|
|
16
|
+
body: '{}',
|
|
17
|
+
metadata: { config: {} },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
mocks: defaultMocks,
|
|
21
|
+
})
|
|
22
|
+
expect(wrapper.vm).toBeTruthy()
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { defaultMocks } from '@windward/core/test/mocks'
|
|
3
|
+
import SevenStrikesSettingsManager from '@/components/settings/SevenStrikesSettingsManager'
|
|
4
|
+
|
|
5
|
+
import Vuetify from 'vuetify'
|
|
6
|
+
import Vue from 'vue'
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
const settings = {}
|
|
10
|
+
const context = 'block'
|
|
11
|
+
|
|
12
|
+
describe('Seven Strikes slides manager', () => {
|
|
13
|
+
test('is a Vue instance', () => {
|
|
14
|
+
const wrapper = shallowMount(SevenStrikesSettingsManager, {
|
|
15
|
+
propsData: {
|
|
16
|
+
settings: settings,
|
|
17
|
+
context: context,
|
|
18
|
+
data: {},
|
|
19
|
+
},
|
|
20
|
+
mocks: defaultMocks,
|
|
21
|
+
})
|
|
22
|
+
expect(wrapper.vm).toBeTruthy()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('can add word', () => {
|
|
26
|
+
const wrapper = shallowMount(SevenStrikesSettingsManager, {
|
|
27
|
+
propsData: {
|
|
28
|
+
settings: settings,
|
|
29
|
+
context: context,
|
|
30
|
+
data: {},
|
|
31
|
+
},
|
|
32
|
+
mocks: defaultMocks,
|
|
33
|
+
})
|
|
34
|
+
wrapper.vm.onAddElement()
|
|
35
|
+
expect(wrapper.vm.block.metadata.config.words).toEqual([
|
|
36
|
+
{ value: '', expand: false, hint: '', splitWord: '' },
|
|
37
|
+
{ value: '', expand: true, hint: '', splitWord: '' },
|
|
38
|
+
])
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
test('can delete a word', () => {
|
|
42
|
+
const wrapper = shallowMount(SevenStrikesSettingsManager, {
|
|
43
|
+
propsData: {
|
|
44
|
+
settings: settings,
|
|
45
|
+
context: context,
|
|
46
|
+
data: {},
|
|
47
|
+
},
|
|
48
|
+
mocks: defaultMocks,
|
|
49
|
+
})
|
|
50
|
+
wrapper.vm.onDelete(0)
|
|
51
|
+
expect(wrapper.vm.block.metadata.config.words).toEqual([])
|
|
52
|
+
})
|
|
53
|
+
})
|