@windward/core 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.
- package/.editorconfig +13 -0
- package/.eslintrc.js +11 -0
- package/.prettierrc +4 -0
- package/README.md +86 -0
- package/babel.config.js +1 -0
- package/components/Content/Blocks/Accordion.vue +133 -0
- package/components/Content/Blocks/ClickableIcons.vue +98 -0
- package/components/Content/Blocks/Feedback.vue +323 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert.vue +95 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionOpenResponse.vue +45 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse.vue +55 -0
- package/components/Content/Blocks/Image.vue +116 -0
- package/components/Content/Blocks/Math.vue +87 -0
- package/components/Content/Blocks/Tab.vue +89 -0
- package/components/Content/Blocks/Table.vue +68 -0
- package/components/Content/Blocks/UserUpload/DisplayUserFilesTable.vue +157 -0
- package/components/Content/Blocks/UserUpload/ManageDataTableUserFiles.vue +68 -0
- package/components/Content/Blocks/UserUpload.vue +240 -0
- package/components/Content/Blocks/Video.vue +245 -0
- package/components/Navigation/Items/CourseGlossaryToolNav.vue +39 -0
- package/components/Navigation/Items/GlossaryNav.vue +32 -0
- package/components/Navigation/Items/UserUploadNav.vue +35 -0
- package/components/Settings/AccordionSettings.vue +153 -0
- package/components/Settings/ClickableIconsSettings.vue +189 -0
- package/components/Settings/FeedbackSettings.vue +92 -0
- package/components/Settings/ImageSettings.vue +124 -0
- package/components/Settings/MathSettings.vue +81 -0
- package/components/Settings/TabSettings.vue +139 -0
- package/components/Settings/TextEditorSettings.vue +249 -0
- package/components/Settings/UserUploadSettings.vue +151 -0
- package/components/Settings/VideoSettings.vue +699 -0
- package/components/utils/ContentViewer.vue +69 -0
- package/components/utils/MathExpressionEditor.vue +294 -0
- package/components/utils/MathLiveWrapper.vue +86 -0
- package/components/utils/TinyMCEWrapper.vue +103 -0
- package/components/utils/glossary/CourseGlossary.vue +284 -0
- package/components/utils/glossary/CourseGlossaryForm.vue +106 -0
- package/components/utils/glossary/GlossaryToolTip.vue +87 -0
- package/config/tinymce.config.js +136 -0
- package/helpers/GlossaryHelper.ts +137 -0
- package/helpers/GlossaryTerm.ts +31 -0
- package/helpers/MathHelper.ts +236 -0
- package/helpers/tinymce/plugin.ts +83 -0
- package/i18n/en-US/components/content/blocks/feedback.ts +28 -0
- package/i18n/en-US/components/content/blocks/image.ts +5 -0
- package/i18n/en-US/components/content/blocks/index.ts +15 -0
- package/i18n/en-US/components/content/blocks/tab.ts +4 -0
- package/i18n/en-US/components/content/blocks/table.ts +4 -0
- package/i18n/en-US/components/content/blocks/user_upload.ts +12 -0
- package/i18n/en-US/components/content/blocks/video.ts +53 -0
- package/i18n/en-US/components/content/index.ts +5 -0
- package/i18n/en-US/components/index.ts +12 -0
- package/i18n/en-US/components/navigation/image.ts +4 -0
- package/i18n/en-US/components/navigation/index.ts +7 -0
- package/i18n/en-US/components/navigation/user_upload.ts +3 -0
- package/i18n/en-US/components/settings/clickable_icon.ts +9 -0
- package/i18n/en-US/components/settings/image.ts +1 -0
- package/i18n/en-US/components/settings/index.ts +13 -0
- package/i18n/en-US/components/settings/text_editor.ts +7 -0
- package/i18n/en-US/components/settings/user_upload.ts +11 -0
- package/i18n/en-US/components/settings/video.ts +13 -0
- package/i18n/en-US/components/utils/index.ts +5 -0
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +7 -0
- package/i18n/en-US/index.ts +16 -0
- package/i18n/en-US/modules/index.ts +5 -0
- package/i18n/en-US/pages/glossary.ts +7 -0
- package/i18n/en-US/pages/index.ts +7 -0
- package/i18n/en-US/pages/user_upload.ts +3 -0
- package/i18n/en-US/shared/content_blocks.ts +20 -0
- package/i18n/en-US/shared/index.ts +11 -0
- package/i18n/en-US/shared/menu.ts +3 -0
- package/i18n/en-US/shared/permission.ts +15 -0
- package/i18n/en-US/shared/settings.ts +15 -0
- package/index.js +15 -0
- package/jest.config.js +15 -0
- package/models/SurveyResult.ts +8 -0
- package/models/SurveyTemplate.ts +8 -0
- package/models/UserFileAsset.ts +12 -0
- package/package.json +48 -0
- package/pages/glossary.vue +31 -0
- package/pages/userUpload.vue +204 -0
- package/plugin.js +299 -0
- package/test/Components/Content/Blocks/Accordion.spec.js +21 -0
- package/test/Components/Content/Blocks/ClickableIcons.spec.js +21 -0
- package/test/Components/Content/Blocks/Feedback.spec.js +31 -0
- package/test/Components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert.spec.js +23 -0
- package/test/Components/Content/Blocks/FeedbackTemplates/FeedbackQuestionOpenResponse.spec.js +23 -0
- package/test/Components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse.spec.js +23 -0
- package/test/Components/Content/Blocks/Image.spec.js +34 -0
- package/test/Components/Content/Blocks/Math.spec.js +34 -0
- package/test/Components/Content/Blocks/Tab.spec.js +20 -0
- package/test/Components/Content/Blocks/Table.spec.js +21 -0
- package/test/Components/Content/Blocks/UserUpload.spec.js +25 -0
- package/test/Components/Content/Blocks/Video.spec.js +112 -0
- package/test/Components/Settings/AccordionSettings.spec.js +45 -0
- package/test/Components/Settings/ClickableIconsSettings.spec.js +20 -0
- package/test/Components/Settings/FeedbackSettings.spec.js +20 -0
- package/test/Components/Settings/ImageSettings.spec.js +20 -0
- package/test/Components/Settings/MathSettings.spec.js +20 -0
- package/test/Components/Settings/TabSettings.spec.js +45 -0
- package/test/Components/Settings/UserUploadSettings.spec.js +20 -0
- package/test/__mocks__/componentsMock.js +83 -0
- package/test/__mocks__/contentBlockMock.js +119 -0
- package/test/__mocks__/contentSettingsMock.js +54 -0
- package/test/__mocks__/fileMock.js +1 -0
- package/test/__mocks__/helpersMock.js +53 -0
- package/test/__mocks__/modelMock.js +82 -0
- package/test/__mocks__/styleMock.js +1 -0
- package/test/helpers/GlossaryHelper.spec.js +227 -0
- package/test/helpers/MathHelper.spec.js +128 -0
- package/test/mocks.js +140 -0
- package/tsconfig.json +15 -0
- package/utils/index.js +18 -0
package/plugin.js
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import enUS from './i18n/en-US'
|
|
2
|
+
|
|
3
|
+
// Content Blocks
|
|
4
|
+
import Video from './components/Content/Blocks/Video'
|
|
5
|
+
import Table from './components/Content/Blocks/Table'
|
|
6
|
+
import Tab from './components/Content/Blocks/Tab'
|
|
7
|
+
import Math from './components/Content/Blocks/Math'
|
|
8
|
+
import MathExpressionEditor from './components/utils/MathExpressionEditor'
|
|
9
|
+
import Accordion from './components/Content/Blocks/Accordion'
|
|
10
|
+
import Feedback from './components/Content/Blocks/Feedback.vue'
|
|
11
|
+
import ClickableIcons from './components/Content/Blocks/ClickableIcons'
|
|
12
|
+
|
|
13
|
+
import UserUploadNav from './components/Navigation/Items/UserUploadNav.vue'
|
|
14
|
+
|
|
15
|
+
import Image from './components/Content/Blocks/Image'
|
|
16
|
+
import UserUpload from './components/Content/Blocks/UserUpload'
|
|
17
|
+
|
|
18
|
+
import GlossaryPage from './pages/glossary.vue'
|
|
19
|
+
import CourseGlossaryToolNav from './components/Navigation/Items/CourseGlossaryToolNav.vue'
|
|
20
|
+
import GlossaryNav from './components/Navigation/Items/GlossaryNav.vue'
|
|
21
|
+
// Entrypoint for npm
|
|
22
|
+
import ImageSettings from './components/Settings/ImageSettings.vue'
|
|
23
|
+
import UserUploadSettings from './components/Settings/UserUploadSettings.vue'
|
|
24
|
+
import ClickableIconsSettings from './components/Settings/ClickableIconsSettings.vue'
|
|
25
|
+
import VideoSettings from './components/Settings/VideoSettings.vue'
|
|
26
|
+
import AccordionSettings from './components/Settings/AccordionSettings.vue'
|
|
27
|
+
import TabSettings from './components/Settings/TabSettings.vue'
|
|
28
|
+
import FeedbackSettings from './components/Settings/FeedbackSettings.vue'
|
|
29
|
+
|
|
30
|
+
import UserUploadPage from './pages/userUpload.vue'
|
|
31
|
+
import GlossaryToolTip from './components/utils/glossary/GlossaryToolTip.vue'
|
|
32
|
+
import TextEditorSettings from './components/Settings/TextEditorSettings.vue'
|
|
33
|
+
import MathSettings from './components/Settings/MathSettings.vue'
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'windward.core.name',
|
|
37
|
+
hooks: {
|
|
38
|
+
beforeContent: (body) => {
|
|
39
|
+
console.log('Hello world from beforeContent hook')
|
|
40
|
+
return body
|
|
41
|
+
},
|
|
42
|
+
beforeDestroy: () => {},
|
|
43
|
+
beforeNavigate: () => {},
|
|
44
|
+
onNavigate: () => {},
|
|
45
|
+
onLoad: (page) => {},
|
|
46
|
+
onContent: () => {},
|
|
47
|
+
},
|
|
48
|
+
i18n: {
|
|
49
|
+
'en-US': enUS,
|
|
50
|
+
},
|
|
51
|
+
pages: [
|
|
52
|
+
{
|
|
53
|
+
page: 'user-uploads',
|
|
54
|
+
path: '/course/:course/user-uploads',
|
|
55
|
+
i18n: 'menu.user-upload',
|
|
56
|
+
icon: 'mdi-cloud-upload',
|
|
57
|
+
name: 'PluginUserUploadPage',
|
|
58
|
+
template: UserUploadPage,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
page: 'glossary',
|
|
62
|
+
path: '/course/:course/glossary',
|
|
63
|
+
i18n: 'windward.core.shared.menu.course_glossary',
|
|
64
|
+
icon: 'mdi-comment-text-multiple',
|
|
65
|
+
name: 'CourseGlossaryPage',
|
|
66
|
+
template: GlossaryPage,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
components: {
|
|
70
|
+
utils: [
|
|
71
|
+
{
|
|
72
|
+
tag: 'core-glossary-tool-tip',
|
|
73
|
+
template: GlossaryToolTip,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
tag: 'core-math-expression-editor',
|
|
77
|
+
template: MathExpressionEditor,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
menu: [
|
|
81
|
+
{
|
|
82
|
+
tag: 'core-user-upload-nav',
|
|
83
|
+
template: UserUploadNav,
|
|
84
|
+
context: ['course'],
|
|
85
|
+
display: ['menu'],
|
|
86
|
+
permissions: {
|
|
87
|
+
'windward.organization.course.file': {
|
|
88
|
+
writeable: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
tag: 'core-user-glossary-nav',
|
|
94
|
+
template: GlossaryNav,
|
|
95
|
+
context: ['course'],
|
|
96
|
+
display: ['menu'],
|
|
97
|
+
permissions: {
|
|
98
|
+
'windward.organization.course.content': {
|
|
99
|
+
readable: true,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
tag: 'core-course-glossary-tool-nav',
|
|
105
|
+
page: 'course glossary',
|
|
106
|
+
i18n: 'windward.core.shared.menu.course_glossary',
|
|
107
|
+
template: CourseGlossaryToolNav,
|
|
108
|
+
icon: 'mdi-comment-text-multiple',
|
|
109
|
+
path: '/course/{course_id}',
|
|
110
|
+
context: ['course'],
|
|
111
|
+
display: ['course_tools'],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
contentBlock: [
|
|
115
|
+
{
|
|
116
|
+
tag: 'core-video',
|
|
117
|
+
template: Video,
|
|
118
|
+
metadata: {
|
|
119
|
+
icon: 'mdi-video',
|
|
120
|
+
name: 'windward.core.shared.content_blocks.title.video',
|
|
121
|
+
grouping:
|
|
122
|
+
'windward.core.shared.content_blocks.grouping.multimedia',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
tag: 'core-table',
|
|
127
|
+
template: Table,
|
|
128
|
+
metadata: {
|
|
129
|
+
icon: 'mdi-table',
|
|
130
|
+
name: 'windward.core.shared.content_blocks.title.default_table',
|
|
131
|
+
grouping:
|
|
132
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
tag: 'core-tab',
|
|
137
|
+
template: Tab,
|
|
138
|
+
metadata: {
|
|
139
|
+
icon: 'mdi-tab',
|
|
140
|
+
name: 'windward.core.shared.content_blocks.title.tab',
|
|
141
|
+
grouping:
|
|
142
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
tag: 'core-math',
|
|
147
|
+
template: Math,
|
|
148
|
+
metadata: {
|
|
149
|
+
icon: 'mdi-math-integral',
|
|
150
|
+
name: 'windward.core.shared.content_blocks.title.math',
|
|
151
|
+
grouping:
|
|
152
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
tag: 'core-accordion',
|
|
157
|
+
template: Accordion,
|
|
158
|
+
metadata: {
|
|
159
|
+
icon: 'mdi-view-list',
|
|
160
|
+
name: 'windward.core.shared.content_blocks.title.accordion',
|
|
161
|
+
grouping:
|
|
162
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
tag: 'core-image',
|
|
167
|
+
template: Image,
|
|
168
|
+
metadata: {
|
|
169
|
+
icon: 'mdi-image',
|
|
170
|
+
name: 'windward.core.shared.content_blocks.title.image',
|
|
171
|
+
grouping:
|
|
172
|
+
'windward.core.shared.content_blocks.grouping.multimedia',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
tag: 'core-user-upload',
|
|
177
|
+
template: UserUpload,
|
|
178
|
+
metadata: {
|
|
179
|
+
icon: 'mdi-cloud-upload',
|
|
180
|
+
name: 'windward.core.shared.content_blocks.title.user_upload',
|
|
181
|
+
grouping:
|
|
182
|
+
'windward.core.shared.content_blocks.grouping.multimedia',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
tag: 'core-clickable-icons',
|
|
187
|
+
template: ClickableIcons,
|
|
188
|
+
metadata: {
|
|
189
|
+
icon: 'mdi-format-list-checks',
|
|
190
|
+
name: 'windward.core.shared.content_blocks.title.clickable_icons',
|
|
191
|
+
grouping:
|
|
192
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
tag: 'core-feedback',
|
|
197
|
+
template: Feedback,
|
|
198
|
+
metadata: {
|
|
199
|
+
icon: 'mdi-message',
|
|
200
|
+
name: 'plugin.core.shared.content_blocks.title.feedback',
|
|
201
|
+
grouping:
|
|
202
|
+
'plugin.core.shared.content_blocks.grouping.basic',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
settings: [
|
|
207
|
+
{
|
|
208
|
+
tag: 'core-image-settings',
|
|
209
|
+
template: ImageSettings,
|
|
210
|
+
context: ['block.core-image'],
|
|
211
|
+
metadata: {
|
|
212
|
+
icon: 'mdi-cog',
|
|
213
|
+
name: 'windward.core.shared.settings.title.image',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
tag: 'core-user-upload-settings',
|
|
218
|
+
template: UserUploadSettings,
|
|
219
|
+
context: ['block.core-user-upload'],
|
|
220
|
+
metadata: {
|
|
221
|
+
icon: 'mdi-cog',
|
|
222
|
+
name: 'windward.core.shared.settings.title.user_upload',
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
tag: 'core-tab-settings',
|
|
227
|
+
template: TabSettings,
|
|
228
|
+
context: ['block.core-tab'],
|
|
229
|
+
metadata: {
|
|
230
|
+
icon: 'mdi-cog',
|
|
231
|
+
name: 'windward.core.shared.settings.title.tab_settings',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
tag: 'core-clickable-icon-setting',
|
|
236
|
+
template: ClickableIconsSettings,
|
|
237
|
+
context: ['block.core-clickable-icons'],
|
|
238
|
+
metadata: {
|
|
239
|
+
icon: 'mdi-cog',
|
|
240
|
+
name: 'windward.core.shared.settings.title.clickable_icons',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
tag: 'core-video-settings',
|
|
245
|
+
template: VideoSettings,
|
|
246
|
+
context: ['block.core-video'],
|
|
247
|
+
metadata: {
|
|
248
|
+
icon: 'mdi-cog',
|
|
249
|
+
name: 'windward.core.shared.settings.title.video',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
tag: 'core-accordion-settings',
|
|
254
|
+
template: AccordionSettings,
|
|
255
|
+
context: ['block.core-accordion'],
|
|
256
|
+
metadata: {
|
|
257
|
+
icon: 'mdi-cog',
|
|
258
|
+
name: 'windward.core.shared.settings.title.accordion',
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
tag: 'core-table-settings',
|
|
263
|
+
template: TextEditorSettings,
|
|
264
|
+
context: ['block.core-table'],
|
|
265
|
+
metadata: {
|
|
266
|
+
icon: 'mdi-cog',
|
|
267
|
+
name: 'windward.core.shared.settings.title.table',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
tag: 'core-text-glossary-setting',
|
|
272
|
+
template: TextEditorSettings,
|
|
273
|
+
context: ['block.content-blocks-text'],
|
|
274
|
+
metadata: {
|
|
275
|
+
icon: 'mdi-notebook-outline',
|
|
276
|
+
name: 'windward.core.shared.settings.title.text_editor',
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
tag: 'core-math-settings',
|
|
281
|
+
template: MathSettings,
|
|
282
|
+
context: ['block.core-math'],
|
|
283
|
+
metadata: {
|
|
284
|
+
icon: 'mdi-notebook-outline',
|
|
285
|
+
name: 'windward.core.shared.settings.title.math',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
tag: 'core-feedback-settings',
|
|
290
|
+
template: FeedbackSettings,
|
|
291
|
+
context: ['block.core-feedback'],
|
|
292
|
+
metadata: {
|
|
293
|
+
icon: 'mdi-notebook-outline',
|
|
294
|
+
name: 'plugin.core.shared.settings.title.feedback',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import Accordion from '@/components/Content/Blocks/Accordion'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('Accordion', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(Accordion, {
|
|
12
|
+
propsData: {
|
|
13
|
+
value: {
|
|
14
|
+
body: 'accordion',
|
|
15
|
+
metadata: { config: {} },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
expect(wrapper.vm).toBeTruthy()
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
|
|
5
|
+
import { defaultMocks } from '@/test/mocks'
|
|
6
|
+
import ClickableIcons from '@/components/Content/Blocks/ClickableIcons'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuetify)
|
|
9
|
+
|
|
10
|
+
describe('ContentClickableIcon component', () => {
|
|
11
|
+
test('is a Vue instance', () => {
|
|
12
|
+
const wrapper = shallowMount(ClickableIcons, {
|
|
13
|
+
vuetify: new Vuetify(),
|
|
14
|
+
mocks: defaultMocks,
|
|
15
|
+
propsData: {
|
|
16
|
+
value: { body: 'clickable_icon', metadata: { config: {} } },
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
expect(wrapper.vm).toBeTruthy()
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import Feedback from '@/components/Content/Blocks/Feedback'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('Feedback', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(Feedback, {
|
|
12
|
+
vuetify: new Vuetify(),
|
|
13
|
+
propsData: {
|
|
14
|
+
value: {
|
|
15
|
+
body: 'feedback',
|
|
16
|
+
metadata: {
|
|
17
|
+
config: {
|
|
18
|
+
definition: {
|
|
19
|
+
metadata: {
|
|
20
|
+
definition: { body: 'test', response: '' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
mocks: defaultMocks,
|
|
28
|
+
})
|
|
29
|
+
expect(wrapper.vm).toBeTruthy()
|
|
30
|
+
})
|
|
31
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import FeedbackQuestionLikert from '@/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('FeedbackQuestionLikert', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(FeedbackQuestionLikert, {
|
|
12
|
+
vuetify: new Vuetify(),
|
|
13
|
+
propsData: {
|
|
14
|
+
value: {
|
|
15
|
+
body: 'Test',
|
|
16
|
+
response: '',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
mocks: defaultMocks,
|
|
20
|
+
})
|
|
21
|
+
expect(wrapper.vm).toBeTruthy()
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import FeedbackQuestionOpenResponse from '@/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionOpenResponse'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('FeedbackQuestionOpenResponse', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(FeedbackQuestionOpenResponse, {
|
|
12
|
+
vuetify: new Vuetify(),
|
|
13
|
+
propsData: {
|
|
14
|
+
value: {
|
|
15
|
+
body: 'Test',
|
|
16
|
+
response: '',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
mocks: defaultMocks,
|
|
20
|
+
})
|
|
21
|
+
expect(wrapper.vm).toBeTruthy()
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import FeedbackQuestionTrueFalse from '@/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('FeedbackQuestionTrueFalse', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(FeedbackQuestionTrueFalse, {
|
|
12
|
+
vuetify: new Vuetify(),
|
|
13
|
+
propsData: {
|
|
14
|
+
value: {
|
|
15
|
+
body: 'Test',
|
|
16
|
+
response: '',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
mocks: defaultMocks,
|
|
20
|
+
})
|
|
21
|
+
expect(wrapper.vm).toBeTruthy()
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import Image from '@/components/Content/Blocks/Image.vue'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('Image content block component', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(Image, {
|
|
12
|
+
vuetify: new Vuetify(),
|
|
13
|
+
mocks: defaultMocks,
|
|
14
|
+
propsData: {
|
|
15
|
+
value: {
|
|
16
|
+
id: '00000000-0000-0000-0000-000000000000',
|
|
17
|
+
name: 'Test Content Page',
|
|
18
|
+
body: 'https://windward-api-core.local/storage/assets/YiyFPcsvrYjIVjwgFLA8rxRtXkeF3LBtjupnIQJL.jpg',
|
|
19
|
+
metadata: {
|
|
20
|
+
source: {
|
|
21
|
+
name: 'my_image.jpg',
|
|
22
|
+
filename:
|
|
23
|
+
'assets/YiyFPcsvrYjIVjwgFLA8rxRtXkeF3LBtjupnIQJL.jpg',
|
|
24
|
+
public_url:
|
|
25
|
+
'https://windward-api-core.local/storage/assets/YiyFPcsvrYjIVjwgFLA8rxRtXkeF3LBtjupnIQJL.jpg',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
expect(wrapper.vm).toBeTruthy()
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import CoreMath from '@/components/Content/Blocks/Math.vue'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
jest.mock(
|
|
10
|
+
'~/config/tinymce.config',
|
|
11
|
+
() => {
|
|
12
|
+
return jest.fn().mockImplementation(() => {
|
|
13
|
+
return { test: () => {} }
|
|
14
|
+
})
|
|
15
|
+
},
|
|
16
|
+
{ virtual: true }
|
|
17
|
+
)
|
|
18
|
+
describe('ContentMathEditor component', () => {
|
|
19
|
+
test('is a Vue instance', () => {
|
|
20
|
+
const wrapper = shallowMount(CoreMath, {
|
|
21
|
+
vuetify: new Vuetify(),
|
|
22
|
+
propsData: {
|
|
23
|
+
value: {
|
|
24
|
+
id: '00000000-0000-0000-0000-000000000000',
|
|
25
|
+
name: 'Test Content Page',
|
|
26
|
+
body: 'dummy text',
|
|
27
|
+
metadata: { config: {} },
|
|
28
|
+
},
|
|
29
|
+
content: 'test',
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
expect(wrapper.vm).toBeTruthy()
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
|
|
5
|
+
import { defaultMocks } from '@/test/mocks'
|
|
6
|
+
import Tab from '@/components/Content/Blocks/Tab'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuetify)
|
|
9
|
+
|
|
10
|
+
describe('Tab', () => {
|
|
11
|
+
test('is a Vue instance', () => {
|
|
12
|
+
const wrapper = shallowMount(Tab, {
|
|
13
|
+
propsData: {
|
|
14
|
+
value: { body: 'tab', metadata: { config: {} } },
|
|
15
|
+
},
|
|
16
|
+
mocks: defaultMocks,
|
|
17
|
+
})
|
|
18
|
+
expect(wrapper.vm).toBeTruthy()
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
|
|
5
|
+
import { defaultMocks } from '@/test/mocks'
|
|
6
|
+
import Table from '@/components/Content/Blocks/Table'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuetify)
|
|
9
|
+
|
|
10
|
+
describe('Table Component', () => {
|
|
11
|
+
test('is a Vue instance', () => {
|
|
12
|
+
const wrapper = shallowMount(Table, {
|
|
13
|
+
vuetify: new Vuetify(),
|
|
14
|
+
mocks: defaultMocks,
|
|
15
|
+
propsData: {
|
|
16
|
+
value: { body: 'Table', metadata: { config: {} } },
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
expect(wrapper.vm).toBeTruthy()
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
|
|
5
|
+
import { defaultMocks } from '@/test/mocks'
|
|
6
|
+
import UserUpload from '@/components/Content/Blocks/UserUpload.vue'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuetify)
|
|
9
|
+
|
|
10
|
+
describe('UserUpload component', () => {
|
|
11
|
+
test('is a Vue instance', () => {
|
|
12
|
+
const wrapper = shallowMount(UserUpload, {
|
|
13
|
+
vuetify: new Vuetify(),
|
|
14
|
+
propsData: {
|
|
15
|
+
value: {
|
|
16
|
+
id: '00000000-0000-0000-0000-000000000000',
|
|
17
|
+
body: 'dummy text',
|
|
18
|
+
metadata: {},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
mocks: defaultMocks,
|
|
22
|
+
})
|
|
23
|
+
expect(wrapper.vm).toBeTruthy()
|
|
24
|
+
})
|
|
25
|
+
})
|