@windward/games 0.0.10 → 0.1.1

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.
Files changed (80) hide show
  1. package/components/content/CrudTable.vue +2 -2
  2. package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +4 -2
  3. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +14 -12
  4. package/components/content/blocks/dragDrop/BucketGame.vue +14 -15
  5. package/components/content/blocks/dragDrop/SortingGame.vue +4 -4
  6. package/components/content/blocks/flashcards/CardFace.vue +38 -39
  7. package/components/content/blocks/flashcards/Flashcard.vue +109 -28
  8. package/components/content/blocks/flashcards/FlashcardSlides.vue +1 -2
  9. package/components/content/blocks/matchingGame/MatchingGame.vue +15 -14
  10. package/components/content/blocks/multipleChoice/MultipleChoice.vue +186 -225
  11. package/components/content/blocks/multipleChoice/QuestionDialog.vue +7 -7
  12. package/components/content/blocks/quizshowGame/AnswerPanel.vue +9 -9
  13. package/components/content/blocks/quizshowGame/Gridview.vue +20 -24
  14. package/components/content/blocks/quizshowGame/QuizShow.vue +6 -6
  15. package/components/content/blocks/quizshowGame/feedbackIcons.vue +4 -2
  16. package/components/content/blocks/sevenStrikes/SevenStikes.vue +165 -111
  17. package/components/content/blocks/sevenStrikes/keyboard.vue +9 -2
  18. package/components/content/blocks/slideshow/SlideShow.vue +9 -5
  19. package/components/content/blocks/wordJumble/Jumble.vue +0 -2
  20. package/components/content/blocks/wordJumble/WordJumble.vue +121 -60
  21. package/components/settings/BucketGameSettingsManager.vue +20 -20
  22. package/components/settings/CrosswordPuzzleSettingsManager.vue +114 -181
  23. package/components/settings/FlashCardSlidesManager.vue +46 -63
  24. package/components/settings/MatchingGameManager.vue +19 -19
  25. package/components/settings/MultipleChoiceSettingsManager.vue +130 -140
  26. package/components/settings/QuizShowSettingsManager.vue +17 -17
  27. package/components/settings/SevenStrikesSettingsManager.vue +139 -193
  28. package/components/settings/SlideShowManager.vue +17 -9
  29. package/components/settings/SortingGameSettingsManager.vue +11 -11
  30. package/components/settings/WordJumbleSettingsManager.vue +48 -12
  31. package/i18n/en-US/components/content/blocks/flashcard.ts +1 -0
  32. package/i18n/en-US/components/content/blocks/word_jumble.ts +2 -0
  33. package/i18n/en-US/components/settings/bucket_game.ts +3 -2
  34. package/i18n/en-US/components/settings/flashcard.ts +1 -0
  35. package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
  36. package/i18n/en-US/index.ts +2 -1
  37. package/i18n/es-ES/components/content/blocks/flashcard.ts +1 -0
  38. package/i18n/es-ES/components/content/blocks/word_jumble.ts +2 -0
  39. package/i18n/es-ES/components/settings/bucket_game.ts +3 -2
  40. package/i18n/es-ES/components/settings/flashcard.ts +1 -0
  41. package/i18n/es-ES/components/settings/seven_strikes.ts +2 -2
  42. package/i18n/es-ES/index.ts +2 -1
  43. package/i18n/index.ts +11 -0
  44. package/i18n/sv-SE/components/content/blocks/flashcard.ts +1 -0
  45. package/i18n/sv-SE/components/content/blocks/word_jumble.ts +2 -0
  46. package/i18n/sv-SE/components/settings/bucket_game.ts +2 -2
  47. package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
  48. package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
  49. package/i18n/sv-SE/index.ts +2 -1
  50. package/package.json +1 -1
  51. package/plugin.js +33 -34
  52. package/test/Feature/LocaleKeys.spec.js +11 -0
  53. package/test/__mocks__/componentsMock.js +12 -0
  54. package/test/__mocks__/fileMock.js +1 -0
  55. package/test/__mocks__/modelMock.js +88 -0
  56. package/test/__mocks__/styleMock.js +1 -0
  57. package/test/blocks/crossword/CrosswordPuzzle.spec.js +1 -1
  58. package/test/blocks/dragDrop/BucketGame.spec.js +1 -1
  59. package/test/blocks/dragDrop/SortingGame.spec.js +1 -1
  60. package/test/blocks/flashcards/CardFace.spec.js +1 -1
  61. package/test/blocks/flashcards/FlashCardSlides.spec.js +1 -1
  62. package/test/blocks/flashcards/Flashcard.spec.js +1 -1
  63. package/test/blocks/matchingGame/MatchingGame.spec.js +1 -1
  64. package/test/blocks/multipleChoice/MultipleChoice.spec.js +1 -1
  65. package/test/blocks/multipleChoice/QuestionDialog.spec.js +1 -1
  66. package/test/blocks/quizShow/quizShow.spec.js +1 -1
  67. package/test/blocks/sevenStrikes/sevenStrikes.spec.js +1 -1
  68. package/test/blocks/slideshow/slideshow.spec.js +1 -1
  69. package/test/blocks/wordJumble/Jumble.spec.js +1 -1
  70. package/test/blocks/wordJumble/WordJumble.spec.js +1 -1
  71. package/test/mocks.js +8 -2
  72. package/test/settings/BucketGameManager.spec.js +4 -4
  73. package/test/settings/CrosswordPuzzleManager.spec.js +6 -11
  74. package/test/settings/FlashCardSlidesManager.spec.js +1 -1
  75. package/test/settings/MatchingGameManager.spec.js +1 -1
  76. package/test/settings/MultipleChoiceGameManager.spec.js +1 -1
  77. package/test/settings/SevenStrikesManager.spec.js +1 -1
  78. package/test/settings/SlideShowManager.spec.js +1 -1
  79. package/test/settings/SortingGameManager.spec.js +1 -1
  80. 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 '@windward/core/test/mocks'
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 '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import BucketGame from '@/components/content/blocks/dragDrop/BucketGame'
4
4
 
5
5
  import Vue from 'vue'
@@ -1,5 +1,5 @@
1
1
  import { mount, shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import SortingGame from '@/components/content/blocks/dragDrop/SortingGame'
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 '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import CardFace from '@/components/content/blocks/flashcards/CardFace'
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 '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import FlashcardSlides from '@/components/content/blocks/flashcards/FlashcardSlides'
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 '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import Flashcard from '@/components/content/blocks/flashcards/Flashcard'
4
4
 
5
5
  import Vuetify from 'vuetify'
@@ -1,4 +1,4 @@
1
- import { defaultMocks } from '@windward/core/test/mocks'
1
+ import { defaultMocks } from '@/test/mocks'
2
2
  import MatchingGame from '@/components/content/blocks/matchingGame/MatchingGame.vue'
3
3
  import { shallowMount } from '@vue/test-utils'
4
4
 
@@ -1,4 +1,4 @@
1
- import { defaultMocks } from '@windward/core/test/mocks'
1
+ import { defaultMocks } from '@/test/mocks'
2
2
  import MultipleChoice from '@/components/content/blocks/multipleChoice/MultipleChoice.vue'
3
3
  import { shallowMount } from '@vue/test-utils'
4
4
 
@@ -1,4 +1,4 @@
1
- import { defaultMocks } from '@windward/core/test/mocks'
1
+ import { defaultMocks } from '@/test/mocks'
2
2
  import QuestionDialog from '@/components/content/blocks/multipleChoice/QuestionDialog.vue'
3
3
  import { shallowMount } from '@vue/test-utils'
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { mount, shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import QuizShow from '@/components/content/blocks/quizshowGame/QuizShow'
4
4
 
5
5
  import Vuetify from 'vuetify'
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import SevenStrikes from '@/components/content/blocks/sevenStrikes/SevenStikes'
4
4
 
5
5
  import Vuetify from 'vuetify'
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import SlideShow from '@/components/content/blocks/slideshow/SlideShow'
4
4
 
5
5
  import Vuetify from 'vuetify'
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import Jumble from '@/components/content/blocks/wordJumble/Jumble'
4
4
 
5
5
  import Vuetify from 'vuetify'
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import WordJumble from '@/components/content/blocks/wordJumble/WordJumble'
4
4
 
5
5
  import Vuetify from 'vuetify'
package/test/mocks.js CHANGED
@@ -1,2 +1,8 @@
1
- import mocks from '@windward/core/test/mocks'
2
- export const defaultMocks = mocks
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 '@windward/core/test/mocks'
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 '@windward/core/test/mocks'
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
- description: '',
54
- expand: false,
53
+ clue: '',
55
54
  },
56
55
  {
57
56
  id: 1,
58
57
  word: '',
59
- description: '',
60
- expand: false,
58
+ clue: '',
61
59
  },
62
60
  {
63
61
  id: 2,
64
62
  word: '',
65
- description: '',
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
- description: '',
93
- expand: false,
89
+ clue: '',
94
90
  },
95
91
  {
96
92
  id: 1,
97
93
  word: '',
98
- description: '',
99
- expand: true,
94
+ clue: '',
100
95
  },
101
96
  ])
102
97
  })
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import FlashCardSlidesManager from '@/components/settings/FlashCardSlidesManager'
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 '@windward/core/test/mocks'
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 '@windward/core/test/mocks'
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 '@windward/core/test/mocks'
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 { mount, shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
2
+ import { defaultMocks } from '@/test/mocks'
3
3
  import SlideShowManager from '@/components/settings/SlideShowManager'
4
4
 
5
5
  import Vuetify from 'vuetify'
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils'
2
- import { defaultMocks } from '@windward/core/test/mocks'
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 '@windward/core/test/mocks'
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
  })