@windward/core 0.2.2 → 0.3.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/babel.config.js +1 -1
- package/components/Content/Blocks/Image.vue +1 -1
- package/components/Content/Blocks/UserUpload/ManageDataTableUserFiles.vue +1 -1
- package/components/Content/Blocks/UserUpload.vue +1 -1
- package/components/Navigation/Items/AskTheExpert.vue +2 -1
- package/components/Navigation/Items/CourseGlossaryToolNav.vue +2 -1
- package/components/Settings/AccordionSettings.vue +11 -4
- package/components/Settings/BlockQuoteSettings.vue +9 -1
- package/components/Settings/ClickableIconsSettings.vue +20 -6
- package/components/Settings/EmailSettings.vue +13 -4
- package/components/Settings/FeedbackSettings.vue +2 -1
- package/components/Settings/HorizontalRuleSettings.vue +2 -1
- package/components/Settings/ImageSettings.vue +7 -1
- package/components/Settings/MathSettings.vue +6 -5
- package/components/Settings/OpenResponseCollateSettings.vue +5 -1
- package/components/Settings/OpenResponseSettings.vue +8 -2
- package/components/Settings/ScenarioChoiceSettings.vue +15 -4
- package/components/Settings/TabSettings.vue +12 -4
- package/components/Settings/TextEditorSettings.vue +14 -7
- package/components/Settings/UserUploadSettings.vue +11 -4
- package/components/Settings/VideoSettings.vue +28 -10
- package/components/utils/TinyMCEWrapper.vue +37 -4
- package/components/utils/glossary/CourseGlossary.vue +3 -2
- package/components/utils/glossary/CourseGlossaryForm.vue +1 -1
- package/i18n/en-US/components/content/blocks/image.ts +1 -1
- package/i18n/es-ES/components/content/blocks/image.ts +1 -1
- package/i18n/sv-SE/components/content/blocks/image.ts +1 -1
- package/package.json +1 -1
- package/test/__mocks__/componentsMock.js +57 -97
- package/test/__mocks__/contentBlockMock.js +1 -1
- package/test/__mocks__/contentSettingsMock.js +2 -1
- package/test/__mocks__/helpersMock.js +9 -0
- package/test/__mocks__/modelMock.js +101 -31
|
@@ -1,101 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
'~/components/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
|
|
1
|
+
const shallowMocks = [
|
|
2
|
+
{ path: '~/components/Core/AuditLogList' },
|
|
3
|
+
{ path: '~/components/Core/AvatarUpload' },
|
|
4
|
+
{ path: '~/components/Core/Breadcrumbs' },
|
|
5
|
+
{ path: '~/components/Core/ColorPicker' },
|
|
6
|
+
{ path: '~/components/Core/ContextMenu' },
|
|
7
|
+
{ path: '~/components/Core/DialogBox' },
|
|
8
|
+
{ path: '~/components/Core/DragDirection' },
|
|
9
|
+
{ path: '~/components/Core/FileDropZone' },
|
|
10
|
+
{ path: '~/components/Core/FormButtons' },
|
|
11
|
+
{ path: '~/components/Core/Form', data: { validation: {} } },
|
|
12
|
+
{ path: '~/components/Core/PageTopActionArea' },
|
|
13
|
+
{ path: '~/components/Core/PluginRef' },
|
|
14
|
+
{ path: '~/components/Core/SearchField' },
|
|
15
|
+
{ path: '~/components/Core/SortableExpansionPanel' },
|
|
16
|
+
{ path: '~/components/Core/SpeedDial' },
|
|
17
|
+
{ path: '~/components/Core/TextIconPicker' },
|
|
18
|
+
{ path: '~/components/Core/UserAvatar' },
|
|
19
|
+
{ path: '~/components/Text/TextViewer' },
|
|
20
|
+
{ path: '~/components/Text/TextEditor' },
|
|
21
|
+
]
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
computed: {},
|
|
19
|
-
methods: {},
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{ virtual: true }
|
|
23
|
-
)
|
|
23
|
+
for (const index in shallowMocks) {
|
|
24
|
+
const mockData = shallowMocks[index].data || {}
|
|
25
|
+
const mockProps = shallowMocks[index].props || {}
|
|
26
|
+
const mockComputed = shallowMocks[index].computed || {}
|
|
27
|
+
const mockMethods = shallowMocks[index].methods || {}
|
|
24
28
|
|
|
25
|
-
jest.mock(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
jest.mock(
|
|
30
|
+
shallowMocks[index].path,
|
|
31
|
+
() => {
|
|
32
|
+
return {
|
|
33
|
+
data() {
|
|
34
|
+
return { ...mockData }
|
|
35
|
+
},
|
|
36
|
+
props: mockProps,
|
|
37
|
+
computed: mockComputed,
|
|
38
|
+
methods: mockMethods,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{ virtual: true }
|
|
42
|
+
)
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
'~/components/Text/TextEditor',
|
|
51
|
-
() => {
|
|
52
|
-
return {
|
|
53
|
-
props: {},
|
|
54
|
-
computed: {},
|
|
55
|
-
methods: {},
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{ virtual: true }
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
jest.mock(
|
|
62
|
-
'~/components/Form',
|
|
63
|
-
() => {
|
|
64
|
-
return {
|
|
65
|
-
props: {},
|
|
66
|
-
computed: {},
|
|
67
|
-
methods: {},
|
|
68
|
-
data() {
|
|
69
|
-
return { validation: {} }
|
|
44
|
+
// If the path does not include .vue then stub that out too
|
|
45
|
+
if (!shallowMocks[index].path.includes('.vue')) {
|
|
46
|
+
jest.mock(
|
|
47
|
+
shallowMocks[index].path + '.vue',
|
|
48
|
+
() => {
|
|
49
|
+
return {
|
|
50
|
+
data() {
|
|
51
|
+
return { ...mockData }
|
|
52
|
+
},
|
|
53
|
+
props: mockProps,
|
|
54
|
+
computed: mockComputed,
|
|
55
|
+
methods: mockMethods,
|
|
56
|
+
}
|
|
70
57
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
jest.mock(
|
|
77
|
-
'~/components/Form.vue',
|
|
78
|
-
() => {
|
|
79
|
-
return {
|
|
80
|
-
props: {},
|
|
81
|
-
computed: {},
|
|
82
|
-
methods: {},
|
|
83
|
-
data() {
|
|
84
|
-
return { validation: {} }
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{ virtual: true }
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
jest.mock(
|
|
92
|
-
'~/components/ColorPicker.vue',
|
|
93
|
-
() => {
|
|
94
|
-
return {
|
|
95
|
-
props: {},
|
|
96
|
-
computed: {},
|
|
97
|
-
methods: {},
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{ virtual: true }
|
|
101
|
-
)
|
|
58
|
+
{ virtual: true }
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
jest.mock(
|
|
2
|
+
'!raw-loader!sass-loader!./assets/tinymce/css/content.scss',
|
|
3
|
+
() => {
|
|
4
|
+
return ''
|
|
5
|
+
},
|
|
6
|
+
{ virtual: true }
|
|
7
|
+
)
|
|
8
|
+
|
|
1
9
|
jest.mock(
|
|
2
10
|
'~/helpers/Uuid',
|
|
3
11
|
() => {
|
|
@@ -9,6 +17,7 @@ jest.mock(
|
|
|
9
17
|
},
|
|
10
18
|
{ virtual: true }
|
|
11
19
|
)
|
|
20
|
+
|
|
12
21
|
jest.mock(
|
|
13
22
|
'~/helpers/Download',
|
|
14
23
|
() => {
|
|
@@ -8,15 +8,50 @@ jest.mock('axios')
|
|
|
8
8
|
|
|
9
9
|
// Define any new model mocks here. The imports / mocks will be auto-generated below
|
|
10
10
|
const mockVirtualModels = [
|
|
11
|
+
{ path: '~/models/AskTheExpert', resource: 'user-tools/ask-the-expert' },
|
|
12
|
+
{ path: '~/models/AssessmentQuestion', resource: 'questions' },
|
|
11
13
|
{
|
|
12
|
-
path: '~/models/
|
|
13
|
-
resource: '
|
|
14
|
+
path: '~/models/AssessmentQuestionType',
|
|
15
|
+
resource: 'assessments/questions/types',
|
|
14
16
|
},
|
|
15
|
-
{ path: '~/models/
|
|
17
|
+
{ path: '~/models/AssessmentResult', resource: 'assessment-results' },
|
|
18
|
+
{ path: '~/models/Assessment', resource: 'assessments' },
|
|
19
|
+
{ path: '~/models/ContactSupport', resource: 'user-tools/contact-support' },
|
|
16
20
|
{ path: '~/models/ContentBlock', resource: 'blocks' },
|
|
17
|
-
{ path: '~/models/
|
|
18
|
-
{ path: '~/models/
|
|
21
|
+
{ path: '~/models/Content', resource: 'content' },
|
|
22
|
+
{ path: '~/models/CourseSection', resource: 'sections' },
|
|
19
23
|
{ path: '~/models/Course', resource: 'courses' },
|
|
24
|
+
{ path: '~/models/CourseUserTrack', resource: 'track' },
|
|
25
|
+
{ path: '~/models/Enrollment', resource: 'enrollments' },
|
|
26
|
+
{ path: '~/models/FileAssetNamespace', resource: 'file-namespaces' },
|
|
27
|
+
{ path: '~/models/FileAsset', resource: 'files' },
|
|
28
|
+
{ path: '~/models/GradeMap', resource: 'maps' },
|
|
29
|
+
{ path: '~/models/Grade', resource: 'grades' },
|
|
30
|
+
{ path: '~/models/GradeType', resource: 'grades/types' },
|
|
31
|
+
{ path: '~/models/Locale', resource: 'locales' },
|
|
32
|
+
{ path: '~/models/Note', resource: 'notes' },
|
|
33
|
+
{ path: '~/models/NotificationEvent', resource: 'notifications/events' },
|
|
34
|
+
{ path: '~/models/NotificationTemplate', resource: 'notifications' },
|
|
35
|
+
{ path: '~/models/NotificationType', resource: 'notifications/types' },
|
|
36
|
+
{
|
|
37
|
+
path: '~/models/OrganizationNotification',
|
|
38
|
+
resource: 'organization-notifications',
|
|
39
|
+
},
|
|
40
|
+
{ path: '~/models/Organization', resource: 'organizations' },
|
|
41
|
+
{ path: '~/models/Permission', resource: 'permissions' },
|
|
42
|
+
{ path: '~/models/PermissionType', resource: 'permissions/types' },
|
|
43
|
+
{ path: '~/models/Plugin', resource: 'plugins' },
|
|
44
|
+
{ path: '~/models/repositories/AuthUserRepository', resource: 'users' },
|
|
45
|
+
{ path: '~/models/Role', resource: 'roles' },
|
|
46
|
+
{ path: '~/models/Rubric', resource: 'rubrics' },
|
|
47
|
+
{ path: '~/models/ServiceStatus', resource: 'status' },
|
|
48
|
+
{ path: '~/models/Tenant', resource: 'tenant' },
|
|
49
|
+
{
|
|
50
|
+
path: '~/models/UserContentBlockState',
|
|
51
|
+
resource: 'user-content-block-state',
|
|
52
|
+
},
|
|
53
|
+
{ path: '~/models/UserGrade', resource: 'user-grades' },
|
|
54
|
+
{ path: '~/models/UserNotification', resource: 'notifications' },
|
|
20
55
|
]
|
|
21
56
|
|
|
22
57
|
const mockModels = [
|
|
@@ -24,12 +59,7 @@ const mockModels = [
|
|
|
24
59
|
]
|
|
25
60
|
|
|
26
61
|
// DO NOT ALTER THE BELOW CODE
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
__esModule: true,
|
|
30
|
-
default: class Model {},
|
|
31
|
-
}
|
|
32
|
-
})
|
|
62
|
+
|
|
33
63
|
class mockBaseModel extends mockModel {
|
|
34
64
|
baseURL() {
|
|
35
65
|
return 'http://windwardapi.local'
|
|
@@ -39,6 +69,34 @@ class mockBaseModel extends mockModel {
|
|
|
39
69
|
resolve({ data: {} })
|
|
40
70
|
})
|
|
41
71
|
}
|
|
72
|
+
|
|
73
|
+
integrations() {
|
|
74
|
+
return this
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
where() {
|
|
78
|
+
return this
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
include() {
|
|
82
|
+
return this
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
with() {
|
|
86
|
+
return this
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
for() {
|
|
90
|
+
return this
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get() {
|
|
94
|
+
return []
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
first() {
|
|
98
|
+
return {}
|
|
99
|
+
}
|
|
42
100
|
}
|
|
43
101
|
|
|
44
102
|
jest.mock(
|
|
@@ -52,35 +110,47 @@ jest.mock(
|
|
|
52
110
|
{ virtual: true }
|
|
53
111
|
)
|
|
54
112
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
113
|
+
const registerVirtualModels = function (mockVirtualModelsParam) {
|
|
114
|
+
for (let mockI = 0; mockI < mockVirtualModelsParam.length; mockI++) {
|
|
115
|
+
jest.mock(
|
|
116
|
+
mockVirtualModelsParam[mockI].path,
|
|
117
|
+
() => {
|
|
118
|
+
return {
|
|
119
|
+
__esModule: true,
|
|
120
|
+
default: class Model extends mockBaseModel {
|
|
121
|
+
resource() {
|
|
122
|
+
return (
|
|
123
|
+
mockVirtualModelsParam[mockI].resource ||
|
|
124
|
+
this.constructor.name
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{ virtual: true }
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const registerModels = function (mockModelsParam) {
|
|
136
|
+
for (let mockJ = 0; mockJ < mockModelsParam.length; mockJ++) {
|
|
137
|
+
jest.mock(mockModelsParam[mockJ].path, () => {
|
|
59
138
|
return {
|
|
60
139
|
__esModule: true,
|
|
61
140
|
default: class Model extends mockBaseModel {
|
|
62
141
|
resource() {
|
|
63
142
|
return (
|
|
64
|
-
|
|
143
|
+
mockModelsParam[mockJ].resource ||
|
|
65
144
|
this.constructor.name
|
|
66
145
|
)
|
|
67
146
|
}
|
|
68
147
|
},
|
|
69
148
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
)
|
|
149
|
+
})
|
|
150
|
+
}
|
|
73
151
|
}
|
|
74
152
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
default: class Model extends mockBaseModel {
|
|
80
|
-
resource() {
|
|
81
|
-
return mockModels[mockJ].resource || this.constructor.name
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
}
|
|
153
|
+
registerVirtualModels(mockVirtualModels)
|
|
154
|
+
registerModels(mockModels)
|
|
155
|
+
|
|
156
|
+
export { registerVirtualModels, registerModels }
|