@windward/games 0.0.10 → 0.1.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/components/content/CrudTable.vue +2 -2
- package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +4 -2
- package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +14 -12
- package/components/content/blocks/dragDrop/BucketGame.vue +14 -15
- package/components/content/blocks/dragDrop/SortingGame.vue +4 -4
- package/components/content/blocks/flashcards/CardFace.vue +38 -39
- package/components/content/blocks/flashcards/Flashcard.vue +109 -28
- package/components/content/blocks/flashcards/FlashcardSlides.vue +1 -2
- package/components/content/blocks/matchingGame/MatchingGame.vue +15 -14
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +186 -225
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +7 -7
- package/components/content/blocks/quizshowGame/AnswerPanel.vue +9 -9
- package/components/content/blocks/quizshowGame/Gridview.vue +20 -24
- package/components/content/blocks/quizshowGame/QuizShow.vue +6 -6
- package/components/content/blocks/quizshowGame/feedbackIcons.vue +4 -2
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +153 -108
- package/components/content/blocks/sevenStrikes/keyboard.vue +9 -2
- package/components/content/blocks/slideshow/SlideShow.vue +3 -3
- package/components/content/blocks/wordJumble/Jumble.vue +0 -2
- package/components/content/blocks/wordJumble/WordJumble.vue +117 -60
- package/components/settings/BucketGameSettingsManager.vue +20 -20
- package/components/settings/CrosswordPuzzleSettingsManager.vue +114 -181
- package/components/settings/FlashCardSlidesManager.vue +46 -63
- package/components/settings/MatchingGameManager.vue +19 -19
- package/components/settings/MultipleChoiceSettingsManager.vue +130 -140
- package/components/settings/QuizShowSettingsManager.vue +17 -17
- package/components/settings/SevenStrikesSettingsManager.vue +131 -193
- package/components/settings/SlideShowManager.vue +9 -9
- package/components/settings/SortingGameSettingsManager.vue +11 -11
- package/components/settings/WordJumbleSettingsManager.vue +40 -12
- package/i18n/en-US/components/content/blocks/flashcard.ts +1 -0
- package/i18n/en-US/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/en-US/components/settings/bucket_game.ts +3 -2
- package/i18n/en-US/components/settings/flashcard.ts +1 -0
- package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
- package/i18n/en-US/index.ts +2 -1
- package/i18n/es-ES/components/content/blocks/flashcard.ts +1 -0
- package/i18n/es-ES/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/es-ES/components/settings/bucket_game.ts +3 -2
- package/i18n/es-ES/components/settings/flashcard.ts +1 -0
- package/i18n/es-ES/components/settings/seven_strikes.ts +2 -2
- package/i18n/es-ES/index.ts +2 -1
- package/i18n/index.ts +11 -0
- package/i18n/sv-SE/components/content/blocks/flashcard.ts +1 -0
- package/i18n/sv-SE/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/sv-SE/components/settings/bucket_game.ts +2 -2
- package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
- package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
- package/i18n/sv-SE/index.ts +2 -1
- package/package.json +1 -1
- package/plugin.js +33 -34
- package/test/Feature/LocaleKeys.spec.js +11 -0
- package/test/__mocks__/componentsMock.js +12 -0
- package/test/__mocks__/fileMock.js +1 -0
- package/test/__mocks__/modelMock.js +88 -0
- package/test/__mocks__/styleMock.js +1 -0
- package/test/blocks/crossword/CrosswordPuzzle.spec.js +1 -1
- package/test/blocks/dragDrop/BucketGame.spec.js +1 -1
- package/test/blocks/dragDrop/SortingGame.spec.js +1 -1
- package/test/blocks/flashcards/CardFace.spec.js +1 -1
- package/test/blocks/flashcards/FlashCardSlides.spec.js +1 -1
- package/test/blocks/flashcards/Flashcard.spec.js +1 -1
- package/test/blocks/matchingGame/MatchingGame.spec.js +1 -1
- package/test/blocks/multipleChoice/MultipleChoice.spec.js +1 -1
- package/test/blocks/multipleChoice/QuestionDialog.spec.js +1 -1
- package/test/blocks/quizShow/quizShow.spec.js +1 -1
- package/test/blocks/sevenStrikes/sevenStrikes.spec.js +1 -1
- package/test/blocks/slideshow/slideshow.spec.js +1 -1
- package/test/blocks/wordJumble/Jumble.spec.js +1 -1
- package/test/blocks/wordJumble/WordJumble.spec.js +1 -1
- package/test/mocks.js +8 -2
- package/test/settings/BucketGameManager.spec.js +4 -4
- package/test/settings/CrosswordPuzzleManager.spec.js +6 -11
- package/test/settings/FlashCardSlidesManager.spec.js +1 -1
- package/test/settings/MatchingGameManager.spec.js +1 -1
- package/test/settings/MultipleChoiceGameManager.spec.js +1 -1
- package/test/settings/SevenStrikesManager.spec.js +1 -1
- package/test/settings/SlideShowManager.spec.js +1 -1
- package/test/settings/SortingGameManager.spec.js +1 -1
- package/test/settings/WordJumbleManager.spec.js +1 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Model as mockModel } from 'vue-api-query'
|
|
2
|
+
|
|
3
|
+
import axios from 'axios'
|
|
4
|
+
jest.mock('axios')
|
|
5
|
+
mockModel.$http = axios
|
|
6
|
+
|
|
7
|
+
jest.mock('axios')
|
|
8
|
+
|
|
9
|
+
// Define any new model mocks here. The imports / mocks will be auto-generated below
|
|
10
|
+
const mockVirtualModels = [
|
|
11
|
+
{
|
|
12
|
+
path: '~/models/UserContentBlockState',
|
|
13
|
+
resource: 'user-content-block-state',
|
|
14
|
+
},
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const mockModels = []
|
|
18
|
+
|
|
19
|
+
// DO NOT ALTER THE BELOW CODE
|
|
20
|
+
jest.mock('', () => {
|
|
21
|
+
return {
|
|
22
|
+
__esModule: true,
|
|
23
|
+
default: class Model {},
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
class mockBaseModel extends mockModel {
|
|
27
|
+
baseURL() {
|
|
28
|
+
return 'http://windwardapi.local'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
request(_config) {
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
resolve({ data: {} })
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
jest.mock(
|
|
39
|
+
'~/models/Model',
|
|
40
|
+
() => {
|
|
41
|
+
return {
|
|
42
|
+
__esModule: true,
|
|
43
|
+
default: class Model extends mockBaseModel {},
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{ virtual: true }
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
for (let mockI = 0; mockI < mockVirtualModels.length; mockI++) {
|
|
50
|
+
jest.mock(
|
|
51
|
+
mockVirtualModels[mockI].path,
|
|
52
|
+
() => {
|
|
53
|
+
return {
|
|
54
|
+
__esModule: true,
|
|
55
|
+
default: class Model extends mockBaseModel {
|
|
56
|
+
resource() {
|
|
57
|
+
return (
|
|
58
|
+
mockVirtualModels[mockI].resource ||
|
|
59
|
+
this.constructor.name
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{ virtual: true }
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
for (let mockJ = 0; mockJ < mockModels.length; mockJ++) {
|
|
70
|
+
jest.mock(mockModels[mockJ].path, () => {
|
|
71
|
+
return {
|
|
72
|
+
__esModule: true,
|
|
73
|
+
default: class Model extends mockBaseModel {
|
|
74
|
+
resource() {
|
|
75
|
+
return mockModels[mockJ].resource || this.constructor.name
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
integrations() {
|
|
79
|
+
return this
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get() {
|
|
83
|
+
return []
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import CrosswordPuzzle from '@/components/content/blocks/crosswordPuzzle/CrosswordPuzzle'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import FlashcardSlides from '@/components/content/blocks/flashcards/FlashcardSlides'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
package/test/mocks.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { defaultMocks as coreMocks } from '@windward/core/test/mocks'
|
|
2
|
+
|
|
3
|
+
require('./__mocks__/fileMock')
|
|
4
|
+
require('./__mocks__/styleMock')
|
|
5
|
+
require('./__mocks__/modelMock')
|
|
6
|
+
require('./__mocks__/componentsMock')
|
|
7
|
+
|
|
8
|
+
export const defaultMocks = coreMocks
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import BucketGameSettingsManager from '@/components/settings/BucketGameSettingsManager'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
|
@@ -47,8 +47,8 @@ describe('Bucket game manager', () => {
|
|
|
47
47
|
})
|
|
48
48
|
wrapper.vm.onAddBucket()
|
|
49
49
|
expect(wrapper.vm.block.metadata.config.bucket_titles).toEqual([
|
|
50
|
-
{ title: '', color: '', expand: false },
|
|
51
|
-
{ title: '', color: '', expand: true },
|
|
50
|
+
{ title: '', color: '#eceff1', expand: false },
|
|
51
|
+
{ title: '', color: '#eceff1', expand: true },
|
|
52
52
|
])
|
|
53
53
|
})
|
|
54
54
|
|
|
@@ -99,7 +99,7 @@ describe('Bucket game manager', () => {
|
|
|
99
99
|
})
|
|
100
100
|
wrapper.vm.onConfirmDeleteBucket(0)
|
|
101
101
|
expect(wrapper.vm.block.metadata.config.bucket_titles).toEqual([
|
|
102
|
-
{ title: '', color: '', expand: true },
|
|
102
|
+
{ title: '', color: '#eceff1', expand: true },
|
|
103
103
|
])
|
|
104
104
|
})
|
|
105
105
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import CrosswordPuzzleSettingsManager from '@/components/settings/CrosswordPuzzleSettingsManager'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
|
@@ -50,20 +50,17 @@ describe('Crossword game manager', () => {
|
|
|
50
50
|
{
|
|
51
51
|
id: 0,
|
|
52
52
|
word: '',
|
|
53
|
-
|
|
54
|
-
expand: false,
|
|
53
|
+
clue: '',
|
|
55
54
|
},
|
|
56
55
|
{
|
|
57
56
|
id: 1,
|
|
58
57
|
word: '',
|
|
59
|
-
|
|
60
|
-
expand: false,
|
|
58
|
+
clue: '',
|
|
61
59
|
},
|
|
62
60
|
{
|
|
63
61
|
id: 2,
|
|
64
62
|
word: '',
|
|
65
|
-
|
|
66
|
-
expand: true,
|
|
63
|
+
clue: '',
|
|
67
64
|
},
|
|
68
65
|
])
|
|
69
66
|
})
|
|
@@ -89,14 +86,12 @@ describe('Crossword game manager', () => {
|
|
|
89
86
|
{
|
|
90
87
|
id: 0,
|
|
91
88
|
word: '',
|
|
92
|
-
|
|
93
|
-
expand: false,
|
|
89
|
+
clue: '',
|
|
94
90
|
},
|
|
95
91
|
{
|
|
96
92
|
id: 1,
|
|
97
93
|
word: '',
|
|
98
|
-
|
|
99
|
-
expand: true,
|
|
94
|
+
clue: '',
|
|
100
95
|
},
|
|
101
96
|
])
|
|
102
97
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import MatchingGameManager from '@/components/settings/MatchingGameManager'
|
|
4
4
|
import Vuetify from 'vuetify'
|
|
5
5
|
import Vue from 'vue'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import MultipleChoiceSettingsManager from '@/components/settings/MultipleChoiceSettingsManager'
|
|
4
4
|
import Vuetify from 'vuetify'
|
|
5
5
|
import Vue from 'vue'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import SevenStrikesSettingsManager from '@/components/settings/SevenStrikesSettingsManager'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import SortingGameSettingsManager from '@/components/settings/SortingGameSettingsManager'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils'
|
|
2
|
-
import { defaultMocks } from '
|
|
2
|
+
import { defaultMocks } from '@/test/mocks'
|
|
3
3
|
import WordJumbleSettingsManager from '@/components/settings/WordJumbleSettingsManager'
|
|
4
4
|
|
|
5
5
|
import Vuetify from 'vuetify'
|
|
@@ -49,13 +49,11 @@ describe('WordJumble manager', () => {
|
|
|
49
49
|
id: 1,
|
|
50
50
|
value: '',
|
|
51
51
|
hint: '',
|
|
52
|
-
expand: false,
|
|
53
52
|
},
|
|
54
53
|
{
|
|
55
54
|
id: 2,
|
|
56
55
|
value: '',
|
|
57
56
|
hint: '',
|
|
58
|
-
expand: true,
|
|
59
57
|
},
|
|
60
58
|
])
|
|
61
59
|
})
|
|
@@ -80,7 +78,6 @@ describe('WordJumble manager', () => {
|
|
|
80
78
|
id: 1,
|
|
81
79
|
value: '',
|
|
82
80
|
hint: '',
|
|
83
|
-
expand: true,
|
|
84
81
|
},
|
|
85
82
|
])
|
|
86
83
|
})
|