@windward/games 0.0.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 (68) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintrc.js +11 -0
  3. package/.prettierrc +4 -0
  4. package/README.md +43 -0
  5. package/babel.config.js +1 -0
  6. package/components/content/CrudTable.vue +295 -0
  7. package/components/content/DataTableRowHandler.vue +113 -0
  8. package/components/content/DatableEditor.vue +223 -0
  9. package/components/content/blocks/BaseContentBlock.vue +8 -0
  10. package/components/content/blocks/dragDrop/BucketGame.vue +520 -0
  11. package/components/content/blocks/dragDrop/SortingGame.vue +303 -0
  12. package/components/content/blocks/flashcards/CardFace.vue +112 -0
  13. package/components/content/blocks/flashcards/Flashcard.vue +150 -0
  14. package/components/content/blocks/flashcards/FlashcardSlides.vue +121 -0
  15. package/components/content/blocks/matchingGame/MatchingGame.vue +545 -0
  16. package/components/content/blocks/quizshowGame/AnswerPanel.vue +338 -0
  17. package/components/content/blocks/quizshowGame/Gridview.vue +260 -0
  18. package/components/content/blocks/quizshowGame/QuizShow.vue +516 -0
  19. package/components/content/blocks/quizshowGame/feedbackIcons.vue +41 -0
  20. package/components/content/blocks/slideshow/SlideShow.vue +175 -0
  21. package/components/settings/BucketGameSettingsManager.vue +683 -0
  22. package/components/settings/FlashCardSlidesManager.vue +489 -0
  23. package/components/settings/MatchingGameManager.vue +775 -0
  24. package/components/settings/QuizShowSettingsManager.vue +408 -0
  25. package/components/settings/SlideShowManager.vue +248 -0
  26. package/components/settings/SortingGameSettingsManager.vue +286 -0
  27. package/i18n/en-US/components/content/blocks/bucket_game.ts +39 -0
  28. package/i18n/en-US/components/content/blocks/flashcard.ts +5 -0
  29. package/i18n/en-US/components/content/blocks/index.ts +15 -0
  30. package/i18n/en-US/components/content/blocks/matching_game.ts +26 -0
  31. package/i18n/en-US/components/content/blocks/quizshow_game.ts +35 -0
  32. package/i18n/en-US/components/content/blocks/slideshow.ts +13 -0
  33. package/i18n/en-US/components/content/blocks/sorting_game.ts +5 -0
  34. package/i18n/en-US/components/content/crud_table.ts +6 -0
  35. package/i18n/en-US/components/content/index.ts +7 -0
  36. package/i18n/en-US/components/index.ts +9 -0
  37. package/i18n/en-US/components/navigation/index.ts +5 -0
  38. package/i18n/en-US/components/settings/bucket_game.ts +35 -0
  39. package/i18n/en-US/components/settings/flashcard.ts +26 -0
  40. package/i18n/en-US/components/settings/index.ts +13 -0
  41. package/i18n/en-US/components/settings/matching_game.ts +15 -0
  42. package/i18n/en-US/components/settings/quizshow_game.ts +14 -0
  43. package/i18n/en-US/components/settings/slideshow.ts +11 -0
  44. package/i18n/en-US/index.ts +15 -0
  45. package/i18n/en-US/modules/index.ts +5 -0
  46. package/i18n/en-US/pages/index.ts +5 -0
  47. package/i18n/en-US/shared/content_blocks.ts +14 -0
  48. package/i18n/en-US/shared/index.ts +7 -0
  49. package/i18n/en-US/shared/settings.ts +10 -0
  50. package/i18n/en-US.ts +5 -0
  51. package/jest.config.js +18 -0
  52. package/package.json +51 -0
  53. package/plugin.js +150 -0
  54. package/test/blocks/dragDrop/BucketGame.spec.js +26 -0
  55. package/test/blocks/dragDrop/SortingGame.spec.js +47 -0
  56. package/test/blocks/flashcards/CardFace.spec.js +21 -0
  57. package/test/blocks/flashcards/FlashCardSlides.spec.js +24 -0
  58. package/test/blocks/flashcards/Flashcard.spec.js +24 -0
  59. package/test/blocks/matchingGame/MatchingGame.spec.js +26 -0
  60. package/test/blocks/quizShow/quizShow.spec.js +31 -0
  61. package/test/blocks/slideshow/slideshow.spec.js +24 -0
  62. package/test/mocks.js +2 -0
  63. package/test/settings/BucketGameManager.spec.js +125 -0
  64. package/test/settings/FlashCardSlidesManager.spec.js +24 -0
  65. package/test/settings/MatchingGameManager.spec.js +30 -0
  66. package/test/settings/SlideShowManager.spec.js +30 -0
  67. package/test/settings/SortingGameManager.spec.js +71 -0
  68. package/tsconfig.json +20 -0
package/jest.config.js ADDED
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ moduleNameMapper: {
3
+ '^@/(.*)$': '<rootDir>/$1',
4
+ '^vue$': 'vue/dist/vue.common.js',
5
+ '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
6
+ '<rootDir>/node_modules/@windward/core/test/__mocks__/fileMock.js',
7
+ '\\.(css|less)$':
8
+ '<rootDir>/node_modules/@windward/core/test/__mocks__/styleMock.js',
9
+ },
10
+ moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
11
+ transformIgnorePatterns: ['node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)'],
12
+
13
+ transform: {
14
+ '^.+\\.ts$': 'ts-jest',
15
+ '^.+\\.js$': 'babel-jest',
16
+ '.*\\.(vue)$': 'vue-jest',
17
+ },
18
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@windward/games",
3
+ "version": "0.0.1",
4
+ "description": "Windward UI Plugin Games",
5
+ "main": "plugin.js",
6
+ "scripts": {
7
+ "test": "jest",
8
+ "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
9
+ "build": "tsc"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+ssh://git@bitbucket.org/mindedge/windward-osmt-ui-plugin.git"
14
+ },
15
+ "author": "Ted Celestin",
16
+ "license": "MIT",
17
+ "homepage": "https://bitbucket.org/mindedge/windward-ui-plugin-games#readme",
18
+ "dependencies": {
19
+ "@windward/core": "^0.0.2",
20
+ "eslint": "^8.11.0",
21
+ "lodash": "^4.17.21",
22
+ "prettier": "^2.6.0",
23
+ "vue-excel-editor": "^1.5.19",
24
+ "vue-flashcard": "^1.1.6",
25
+ "vuedraggable": "^2.24.3"
26
+ },
27
+ "devDependencies": {
28
+ "@babel/preset-env": "^7.16.11",
29
+ "@nuxtjs/axios": "^5.13.6",
30
+ "@types/lodash": "^4.14.180",
31
+ "@vue/test-utils": "^1.1.3",
32
+ "babel-core": "^7.0.0-bridge.0",
33
+ "babel-jest": "^26.6.3",
34
+ "eslint-config-prettier": "^8.5.0",
35
+ "eslint-plugin-nuxt": "^3.2.0",
36
+ "eslint-plugin-prettier": "^4.0.0",
37
+ "jest": "^26.6.3",
38
+ "ts-jest": "^26.5.6",
39
+ "typescript": "^4.6.3",
40
+ "vue-api-query": "^1.11.0",
41
+ "vue-i18n": "^8.27.1",
42
+ "vue-jest": "^3.0.7",
43
+ "vuetify": "^2.6.4"
44
+ },
45
+ "bugs": {
46
+ "url": "https://bitbucket.org/mindedge/windward-osmt-ui-plugin/issues"
47
+ },
48
+ "directories": {
49
+ "test": "test"
50
+ }
51
+ }
package/plugin.js ADDED
@@ -0,0 +1,150 @@
1
+ import enUS from './i18n/en-US'
2
+ import flashcards from './components/content/blocks/flashcards/FlashcardSlides'
3
+ import slideShow from './components/content/blocks/slideshow/SlideShow.vue'
4
+ import FlashCardSlidesManager from './components/settings/FlashCardSlidesManager'
5
+ import SlideShowManager from './components/settings/SlideShowManager.vue'
6
+ import MatchingGameManager from './components/settings/MatchingGameManager.vue'
7
+ import MatchingGame from './components/content/blocks/matchingGame/MatchingGame.vue'
8
+ import bucketGameSettingsManager from './components/settings/BucketGameSettingsManager'
9
+ import SortingGame from './components/content/blocks/dragDrop/SortingGame'
10
+ import SortingGameSettingsManager from './components/settings/SortingGameSettingsManager.vue'
11
+ import BucketGame from './components/content/blocks/dragDrop/BucketGame'
12
+ import quizShow from './components/content/blocks/quizshowGame/QuizShow'
13
+ import QuizShowSettingsManager from './components/settings/QuizShowSettingsManager'
14
+
15
+ export default {
16
+ name: 'Windward Games Plugin',
17
+ hooks: {
18
+ beforeContent: (body) => {
19
+ return body
20
+ },
21
+ beforeDestroy: () => {},
22
+ beforeNavigate: () => {},
23
+ onNavigate: () => {},
24
+ onLoad: (page) => {},
25
+ onContent: () => {},
26
+ },
27
+ i18n: {
28
+ 'en-US': enUS,
29
+ },
30
+ components: {
31
+ contentBlock: [
32
+ {
33
+ tag: 'games-flash-card',
34
+ template: flashcards,
35
+ metadata: {
36
+ icon: 'mdi-cards-variant',
37
+ name: 'plugin.games.shared.content_blocks.title.flashcards',
38
+ grouping:
39
+ 'plugin.games.shared.content_blocks.grouping.game',
40
+ },
41
+ },
42
+ {
43
+ tag: 'games-sorting',
44
+ template: SortingGame,
45
+ metadata: {
46
+ icon: 'mdi-sort',
47
+ name: 'plugin.games.shared.content_blocks.title.sort',
48
+ grouping:
49
+ 'plugin.games.shared.content_blocks.grouping.game',
50
+ },
51
+ },
52
+ {
53
+ tag: 'games-bucket',
54
+ template: BucketGame,
55
+ metadata: {
56
+ icon: 'mdi-bucket-outline',
57
+ name: 'plugin.games.shared.content_blocks.title.bucket',
58
+ grouping:
59
+ 'plugin.games.shared.content_blocks.grouping.game',
60
+ },
61
+ },
62
+ {
63
+ tag: 'games-slideshow',
64
+ template: slideShow,
65
+ metadata: {
66
+ icon: 'mdi-view-gallery',
67
+ name: 'plugin.games.shared.content_blocks.title.slideshow',
68
+ grouping:
69
+ 'plugin.games.shared.content_blocks.grouping.multimedia',
70
+ },
71
+ },
72
+ {
73
+ tag: 'games-matching-game',
74
+ template: MatchingGame,
75
+ metadata: {
76
+ icon: 'mdi-image-filter-none',
77
+ name: 'plugin.games.shared.content_blocks.title.matching_game',
78
+ grouping:
79
+ 'plugin.games.shared.content_blocks.grouping.game',
80
+ },
81
+ },
82
+ {
83
+ tag: 'games-quizshow-game',
84
+ template: quizShow,
85
+ metadata: {
86
+ icon: 'mdi-head-question-outline',
87
+ name: 'plugin.games.shared.content_blocks.title.quizshow',
88
+ grouping:
89
+ 'plugin.games.shared.content_blocks.grouping.game',
90
+ },
91
+ },
92
+ ],
93
+ settings: [
94
+ {
95
+ tag: 'games-flashcard-settings',
96
+ template: FlashCardSlidesManager,
97
+ context: ['block.games-flash-card'],
98
+ metadata: {
99
+ icon: 'mdi-cog',
100
+ name: 'plugin.games.shared.settings.title.card_manager',
101
+ },
102
+ },
103
+ {
104
+ tag: 'games-bucket-settings',
105
+ template: bucketGameSettingsManager,
106
+ context: ['block.games-bucket'],
107
+ metadata: {
108
+ icon: 'mdi-cog',
109
+ name: 'plugin.games.shared.settings.title.bucket_manager',
110
+ },
111
+ },
112
+ {
113
+ tag: 'games-sorting-settings',
114
+ template: SortingGameSettingsManager,
115
+ context: ['block.games-sorting'],
116
+ metadata: {
117
+ icon: 'mdi-cog',
118
+ name: 'plugin.games.shared.settings.title.sorting_manager',
119
+ },
120
+ },
121
+ {
122
+ tag: 'games-slideshow-settings',
123
+ template: SlideShowManager,
124
+ context: ['block.games-slideshow'],
125
+ metadata: {
126
+ icon: 'mdi-cog',
127
+ name: 'plugin.games.shared.settings.title.slideshow_manager',
128
+ },
129
+ },
130
+ {
131
+ tag: 'games-matching-setting',
132
+ template: MatchingGameManager,
133
+ context: ['block.games-matching-game'],
134
+ metadata: {
135
+ icon: 'mdi-cog',
136
+ name: 'plugin.games.shared.settings.title.matching_game_manager',
137
+ },
138
+ },
139
+ {
140
+ tag: 'games-quizshow-settings',
141
+ template: QuizShowSettingsManager,
142
+ context: ['block.games-quizshow-game'],
143
+ metadata: {
144
+ icon: 'mdi-cog',
145
+ name: 'plugin.games.shared.settings.title.quizshow_manager',
146
+ },
147
+ },
148
+ ],
149
+ },
150
+ }
@@ -0,0 +1,26 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import BucketGame from '@/components/content/blocks/dragDrop/BucketGame'
4
+
5
+ import Vue from 'vue'
6
+ import Vuetify from 'vuetify'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('BucketGame', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = mount(BucketGame, {
12
+ propsData: {
13
+ value: {
14
+ id: '00000000-0000-0000-0000-000000000000',
15
+ name: 'Test Content Page',
16
+ body: 'dummy text',
17
+ metadata: {
18
+ config: {},
19
+ },
20
+ },
21
+ },
22
+ mocks: defaultMocks,
23
+ })
24
+ expect(wrapper.vm).toBeTruthy()
25
+ })
26
+ })
@@ -0,0 +1,47 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import SortingGame from '@/components/content/blocks/dragDrop/SortingGame'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ //override default mock
10
+ jest.mock(
11
+ 'lodash',
12
+ () => {
13
+ return {
14
+ cloneDeep: () => {
15
+ return []
16
+ },
17
+ isEmpty: () => {
18
+ return jest.fn()
19
+ },
20
+ flatten: () => {
21
+ return jest.fn()
22
+ },
23
+ get: () => {
24
+ return jest.fn()
25
+ },
26
+ }
27
+ },
28
+ { virtual: true }
29
+ )
30
+ describe('SortingGame', () => {
31
+ test('is a Vue instance', () => {
32
+ const wrapper = shallowMount(SortingGame, {
33
+ propsData: {
34
+ value: {
35
+ id: '00000000-0000-0000-0000-000000000000',
36
+ name: 'Test Content Page',
37
+ body: '[]',
38
+ metadata: {
39
+ config: {},
40
+ },
41
+ },
42
+ },
43
+ mocks: defaultMocks,
44
+ })
45
+ expect(wrapper.vm).toBeTruthy()
46
+ })
47
+ })
@@ -0,0 +1,21 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import CardFace from '@/components/content/blocks/flashcards/CardFace'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ const settings = { text: '' }
10
+ describe('CardFace', () => {
11
+ test('is a Vue instance', () => {
12
+ const wrapper = shallowMount(CardFace, {
13
+ propsData: {
14
+ settings,
15
+ textColor: '',
16
+ },
17
+ mocks: defaultMocks,
18
+ })
19
+ expect(wrapper.vm).toBeTruthy()
20
+ })
21
+ })
@@ -0,0 +1,24 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import FlashcardSlides from '@/components/content/blocks/flashcards/FlashcardSlides'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('FlashcardSlides', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(FlashcardSlides, {
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,24 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import Flashcard from '@/components/content/blocks/flashcards/Flashcard'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('FlashCard', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(Flashcard, {
12
+ propsData: {
13
+ options: {
14
+ front: {},
15
+ back: {},
16
+ },
17
+ slide: 1,
18
+ data: {},
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+ })
@@ -0,0 +1,26 @@
1
+ import { defaultMocks } from '@windward/core/test/mocks'
2
+ import MatchingGame from '@/components/content/blocks/matchingGame/MatchingGame.vue'
3
+ import { shallowMount } from '@vue/test-utils'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('MatchingGame', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(MatchingGame, {
12
+ propsData: {
13
+ value: {
14
+ id: '00000000-0000-0000-0000-000000000000',
15
+ name: 'Test Content Page',
16
+ body: '[]',
17
+ metadata: {
18
+ config: {},
19
+ },
20
+ },
21
+ },
22
+ mocks: defaultMocks,
23
+ })
24
+ expect(wrapper.vm).toBeTruthy()
25
+ })
26
+ })
@@ -0,0 +1,31 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import QuizShow from '@/components/content/blocks/quizshowGame/QuizShow'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ // Mock the VueExcel* since it has issues with jest parsing
10
+ jest.mock('vue-excel-editor/src/VueExcelEditor', () => {
11
+ return {}
12
+ })
13
+ jest.mock('vue-excel-editor/src/VueExcelColumn', () => {
14
+ return {}
15
+ })
16
+ describe('QuizShow', () => {
17
+ test('is a Vue instance', () => {
18
+ const wrapper = shallowMount(QuizShow, {
19
+ propsData: {
20
+ value: {
21
+ id: '00000000-0000-0000-0000-000000000000',
22
+ name: 'Test Content Page',
23
+ body: '{}',
24
+ metadata: { config: {} },
25
+ },
26
+ },
27
+ mocks: defaultMocks,
28
+ })
29
+ expect(wrapper.vm).toBeTruthy()
30
+ })
31
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import SlideShow from '@/components/content/blocks/slideshow/SlideShow'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('SlideShow', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(SlideShow, {
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
+ })
package/test/mocks.js ADDED
@@ -0,0 +1,2 @@
1
+ import mocks from '@windward/core/test/mocks'
2
+ export const defaultMocks = mocks
@@ -0,0 +1,125 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import BucketGameSettingsManager from '@/components/settings/BucketGameSettingsManager'
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('Matching game manager', () => {
13
+ test('is a Vue instance', () => {
14
+ const wrapper = shallowMount(BucketGameSettingsManager, {
15
+ propsData: {
16
+ block: {
17
+ id: '00000000-0000-0000-0000-000000000000',
18
+ name: 'Test Content Page',
19
+ body: '{}',
20
+ metadata: { config: {} },
21
+ },
22
+ settings: settings,
23
+ context: context,
24
+ data: {},
25
+ metadata: { config: {} },
26
+ },
27
+ mocks: defaultMocks,
28
+ })
29
+ expect(wrapper.vm).toBeTruthy()
30
+ })
31
+
32
+ test('can add new bucket', () => {
33
+ const wrapper = shallowMount(BucketGameSettingsManager, {
34
+ propsData: {
35
+ block: {
36
+ id: '00000000-0000-0000-0000-000000000000',
37
+ name: 'Test Content Page',
38
+ body: '{}',
39
+ metadata: { config: {} },
40
+ },
41
+ settings: settings,
42
+ context: context,
43
+ data: {},
44
+ metadata: { config: {} },
45
+ },
46
+ mocks: defaultMocks,
47
+ })
48
+ wrapper.vm.onAddBucket()
49
+ expect(wrapper.vm.block.metadata.config.bucket_titles).toEqual([
50
+ { title: '', color: '', expand: false },
51
+ { title: '', color: '', expand: true },
52
+ ])
53
+ })
54
+
55
+ test('can add bucket answer', () => {
56
+ const wrapper = shallowMount(BucketGameSettingsManager, {
57
+ propsData: {
58
+ block: {
59
+ id: '00000000-0000-0000-0000-000000000000',
60
+ name: 'Test Content Page',
61
+ body: '{}',
62
+ metadata: { config: {} },
63
+ },
64
+ settings: settings,
65
+ context: context,
66
+ data: {},
67
+ metadata: { config: {} },
68
+ },
69
+ mocks: defaultMocks,
70
+ })
71
+ wrapper.vm.onAddBucketAnswer(0)
72
+ expect(wrapper.vm.block.metadata.config.bucket_answers[0]).toEqual([
73
+ {
74
+ bucket_index: 0,
75
+ display: '',
76
+ display_value: '',
77
+ feedback: '',
78
+ expand: true,
79
+ id: 2,
80
+ },
81
+ ])
82
+ })
83
+
84
+ test('can delete bucket', () => {
85
+ const wrapper = shallowMount(BucketGameSettingsManager, {
86
+ propsData: {
87
+ block: {
88
+ id: '00000000-0000-0000-0000-000000000000',
89
+ name: 'Test Content Page',
90
+ body: '{}',
91
+ metadata: { config: {} },
92
+ },
93
+ settings: settings,
94
+ context: context,
95
+ data: {},
96
+ metadata: { config: {} },
97
+ },
98
+ mocks: defaultMocks,
99
+ })
100
+ wrapper.vm.onConfirmDeleteBucket(0)
101
+ expect(wrapper.vm.block.metadata.config.bucket_titles).toEqual([
102
+ { title: '', color: '', expand: true },
103
+ ])
104
+ })
105
+
106
+ test('can delete answer', () => {
107
+ const wrapper = shallowMount(BucketGameSettingsManager, {
108
+ propsData: {
109
+ block: {
110
+ id: '00000000-0000-0000-0000-000000000000',
111
+ name: 'Test Content Page',
112
+ body: '{}',
113
+ metadata: { config: {} },
114
+ },
115
+ settings: settings,
116
+ context: context,
117
+ data: {},
118
+ metadata: { config: {} },
119
+ },
120
+ mocks: defaultMocks,
121
+ })
122
+ wrapper.vm.onConfirmDelete(0, 0)
123
+ expect(wrapper.vm.block.metadata.config.bucket_answers).toEqual([])
124
+ })
125
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import FlashCardSlidesManager from '@/components/settings/FlashCardSlidesManager'
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('FLashcard slides manager', () => {
13
+ test('is a Vue instance', () => {
14
+ const wrapper = shallowMount(FlashCardSlidesManager, {
15
+ propsData: {
16
+ settings: settings,
17
+ context: context,
18
+ data: {},
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+ })
@@ -0,0 +1,30 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import MatchingGameManager from '@/components/settings/MatchingGameManager'
4
+ import Vuetify from 'vuetify'
5
+ import Vue from 'vue'
6
+ Vue.use(Vuetify)
7
+
8
+ const settings = {}
9
+ const context = 'block'
10
+
11
+ describe('Matching game manager', () => {
12
+ test('is a Vue instance', () => {
13
+ const wrapper = shallowMount(MatchingGameManager, {
14
+ propsData: {
15
+ block: {
16
+ id: '00000000-0000-0000-0000-000000000000',
17
+ name: 'Test Content Page',
18
+ body: '{}',
19
+ metadata: { config: {} },
20
+ },
21
+ settings: settings,
22
+ context: context,
23
+ data: {},
24
+ metadata: { config: {} },
25
+ },
26
+ mocks: defaultMocks,
27
+ })
28
+ expect(wrapper.vm).toBeTruthy()
29
+ })
30
+ })
@@ -0,0 +1,30 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import SlideShowManager from '@/components/settings/SlideShowManager'
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('Slideshow manager', () => {
13
+ test('is a Vue instance', () => {
14
+ const wrapper = shallowMount(SlideShowManager, {
15
+ propsData: {
16
+ block: {
17
+ id: '00000000-0000-0000-0000-000000000000',
18
+ name: 'Test Content Page',
19
+ body: '{}',
20
+ metadata: { config: {} },
21
+ },
22
+ settings: settings,
23
+ context: context,
24
+ data: {},
25
+ },
26
+ mocks: defaultMocks,
27
+ })
28
+ expect(wrapper.vm).toBeTruthy()
29
+ })
30
+ })