-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
index.js
85 lines (83 loc) · 1.89 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* Internal dependencies
*/
import convertPreferencesPackageData from '../';
const input = {
'core/customize-widgets': {
welcomeGuide: false,
fixedToolbar: true,
},
'core/edit-widgets': {
welcomeGuide: false,
fixedToolbar: true,
showBlockBreadcrumbs: false,
complementaryArea: 'edit-widgets/block-areas',
},
'core/edit-post': {
welcomeGuide: false,
fixedToolbar: true,
fullscreenMode: false,
hiddenBlockTypes: [ 'core/audio', 'core/cover' ],
editorMode: 'visual',
preferredStyleVariations: {
'core/quote': 'large',
},
inactivePanels: [],
openPanels: [ 'post-status' ],
pinnedItems: {
'my-sidebar-plugin/title-sidebar': false,
},
},
'core/edit-site': {
welcomeGuide: false,
welcomeGuideStyles: false,
fixedToolbar: true,
complementaryArea: 'edit-site/global-styles',
},
};
describe( 'convertPreferencesPackageData', () => {
it( 'converts data to the expected format', () => {
expect( convertPreferencesPackageData( input ) )
.toMatchInlineSnapshot( `
{
"core": {
"fixedToolbar": true,
"inactivePanels": [],
"openPanels": [
"post-status",
],
},
"core/customize-widgets": {
"fixedToolbar": true,
"welcomeGuide": false,
},
"core/edit-post": {
"editorMode": "visual",
"fullscreenMode": false,
"hiddenBlockTypes": [
"core/audio",
"core/cover",
],
"pinnedItems": {
"my-sidebar-plugin/title-sidebar": false,
},
"preferredStyleVariations": {
"core/quote": "large",
},
"welcomeGuide": false,
},
"core/edit-site": {
"isComplementaryAreaVisible": true,
"welcomeGuide": false,
"welcomeGuideStyles": false,
},
"core/edit-widgets": {
"fixedToolbar": true,
"isComplementaryAreaVisible": true,
"showBlockBreadcrumbs": false,
"welcomeGuide": false,
},
}
` );
} );
} );