File tree 4 files changed +73
-2
lines changed
4 files changed +73
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,52 @@ import {
7
7
import { useDeepMerge } from '../../src/plugin/composables/helpers' ;
8
8
9
9
10
+ const stepperProps = {
11
+ altLabels : true ,
12
+ autoPage : true ,
13
+ autoPageDelay : 3000 ,
14
+ bgColor : 'secondary' ,
15
+ border : 'lg' ,
16
+ color : 'primary' ,
17
+ density : 'default' as const ,
18
+ disabled : false ,
19
+ editIcon : 'fas fa-pencil' ,
20
+ editable : false ,
21
+ elevation : 10 ,
22
+ errorIcon : 'fas fa-cog' ,
23
+ fieldColumns : {
24
+ lg : 12 ,
25
+ md : 12 ,
26
+ sm : 12 ,
27
+ xl : 12 ,
28
+ } ,
29
+ flat : true ,
30
+ headerTooltips : true ,
31
+ height : '900px' ,
32
+ hideActions : true ,
33
+ hideDetails : true ,
34
+ keepValuesOnUnmount : false ,
35
+ maxHeight : '50px' ,
36
+ maxWidth : '50px' ,
37
+ minHeight : '900px' ,
38
+ minWidth : '900px' ,
39
+ nextText : 'hop forward' ,
40
+ prevText : 'hop backwards' ,
41
+ rounded : 'pill' ,
42
+ selectedClass : 'bunnies' ,
43
+ summaryColumns : { sm : 6 } ,
44
+ tag : 'div' ,
45
+ theme : 'light' ,
46
+ tile : true ,
47
+ tooltipLocation : 'end' as const ,
48
+ tooltipOffset : 10 ,
49
+ tooltipTransition : 'fade-transition' ,
50
+ transition : 'fade-transition' ,
51
+ validateOn : 'blur' as const ,
52
+ validateOnMount : true ,
53
+ variant : 'outlined' ,
54
+ } ;
55
+
10
56
const answers = {
11
57
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Page 1 //
12
58
firstName : null ,
@@ -303,5 +349,6 @@ export {
303
349
buttonFieldOptions ,
304
350
finalAnswer ,
305
351
items ,
352
+ stepperProps ,
306
353
validationSchema ,
307
354
} ;
Original file line number Diff line number Diff line change 1
1
import {
2
+ useBuildSettings ,
2
3
useColumnErrorCheck ,
3
4
useDeepMerge ,
4
5
} from '../helpers' ;
6
+ import * as DATA from '../../../../cypress/templates/testData' ;
7
+
5
8
6
9
describe ( 'Helpers Composable' , ( ) => {
7
10
11
+ describe ( 'useBuildSettings' , ( ) => {
12
+ it ( 'should return the correct settings object' , ( ) => {
13
+ const stepperProps = DATA . stepperProps ;
14
+
15
+ const result = useBuildSettings ( stepperProps ) ;
16
+
17
+ expect ( result ) . to . deep . equal ( stepperProps ) ;
18
+ } ) ;
19
+
20
+ it ( 'should return the incorrect settings object' , ( ) => {
21
+ const stepperProps = DATA . stepperProps ;
22
+
23
+ const result = useBuildSettings ( stepperProps ) ;
24
+
25
+ expect ( result ) . to . not . deep . equal ( {
26
+ ...stepperProps ,
27
+ bunnies : 'fluffy' ,
28
+ } ) ;
29
+ } ) ;
30
+ } ) ;
31
+
8
32
describe ( 'useColumnErrorCheck' , ( ) => {
9
33
describe ( 'Errors' , ( ) => {
10
34
const propName = 'columns' ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import type {
12
12
*/
13
13
type AnyObject = Record < string , any > ;
14
14
15
- export const useDeepMerge : UseDeepMerge = ( A , B , C ) => {
15
+ export const useDeepMerge : UseDeepMerge = ( A , B , C = { } ) => {
16
16
const deepMerge = ( obj1 : AnyObject , obj2 : AnyObject ) : AnyObject => {
17
17
const result : AnyObject = { ...obj1 } ;
18
18
for ( const key in obj2 ) {
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ export interface UseDeepMerge {
258
258
(
259
259
A : Record < string , any > ,
260
260
B : Record < string , any > ,
261
- C : Record < string , any >
261
+ C ? : Record < string , any >
262
262
) : Record < string , any > ;
263
263
}
264
264
You can’t perform that action at this time.
0 commit comments