@wordpress/editor 11.0.2 → 12.0.3

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 (123) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/build/components/autosave-monitor/index.js +5 -0
  4. package/build/components/autosave-monitor/index.js.map +1 -1
  5. package/build/components/character-count/index.js +1 -1
  6. package/build/components/character-count/index.js.map +1 -1
  7. package/build/components/editor-help/help-get-support-button.native.js +46 -0
  8. package/build/components/editor-help/help-get-support-button.native.js.map +1 -0
  9. package/build/components/editor-help/index.native.js +24 -5
  10. package/build/components/editor-help/index.native.js.map +1 -1
  11. package/build/components/entities-saved-states/entity-type-list.js +22 -13
  12. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +23 -4
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-keyboard-shortcuts/save-shortcut.js +12 -14
  16. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  17. package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -4
  18. package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +1 -1
  19. package/build/components/post-format/index.js +3 -1
  20. package/build/components/post-format/index.js.map +1 -1
  21. package/build/components/post-locked-modal/index.js +1 -1
  22. package/build/components/post-locked-modal/index.js.map +1 -1
  23. package/build/components/post-saved-state/index.js +37 -46
  24. package/build/components/post-saved-state/index.js.map +1 -1
  25. package/build/components/post-taxonomies/flat-term-selector.js +154 -211
  26. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  27. package/build/components/post-title/index.js +5 -3
  28. package/build/components/post-title/index.js.map +1 -1
  29. package/build/components/provider/index.native.js +3 -1
  30. package/build/components/provider/index.native.js.map +1 -1
  31. package/build/components/provider/use-block-editor-settings.js +32 -5
  32. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  33. package/build/components/word-count/index.js +1 -1
  34. package/build/components/word-count/index.js.map +1 -1
  35. package/build/store/actions.js +0 -25
  36. package/build/store/actions.js.map +1 -1
  37. package/build/store/selectors.js +3 -84
  38. package/build/store/selectors.js.map +1 -1
  39. package/build/store/utils/notice-builder.js +15 -18
  40. package/build/store/utils/notice-builder.js.map +1 -1
  41. package/build/{store/utils → utils}/get-template-part-icon.js +1 -1
  42. package/build/utils/get-template-part-icon.js.map +1 -0
  43. package/build/utils/index.js +8 -0
  44. package/build/utils/index.js.map +1 -1
  45. package/build-module/components/autosave-monitor/index.js +5 -0
  46. package/build-module/components/autosave-monitor/index.js.map +1 -1
  47. package/build-module/components/character-count/index.js +1 -1
  48. package/build-module/components/character-count/index.js.map +1 -1
  49. package/build-module/components/editor-help/help-get-support-button.native.js +34 -0
  50. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -0
  51. package/build-module/components/editor-help/index.native.js +22 -6
  52. package/build-module/components/editor-help/index.native.js.map +1 -1
  53. package/build-module/components/entities-saved-states/entity-type-list.js +24 -13
  54. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  55. package/build-module/components/entities-saved-states/index.js +23 -4
  56. package/build-module/components/entities-saved-states/index.js.map +1 -1
  57. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +12 -14
  58. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  59. package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -4
  60. package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +1 -1
  61. package/build-module/components/post-format/index.js +4 -2
  62. package/build-module/components/post-format/index.js.map +1 -1
  63. package/build-module/components/post-locked-modal/index.js +1 -1
  64. package/build-module/components/post-locked-modal/index.js.map +1 -1
  65. package/build-module/components/post-saved-state/index.js +38 -46
  66. package/build-module/components/post-saved-state/index.js.map +1 -1
  67. package/build-module/components/post-taxonomies/flat-term-selector.js +156 -214
  68. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  69. package/build-module/components/post-title/index.js +5 -3
  70. package/build-module/components/post-title/index.js.map +1 -1
  71. package/build-module/components/provider/index.native.js +3 -1
  72. package/build-module/components/provider/index.native.js.map +1 -1
  73. package/build-module/components/provider/use-block-editor-settings.js +31 -5
  74. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  75. package/build-module/components/word-count/index.js +1 -1
  76. package/build-module/components/word-count/index.js.map +1 -1
  77. package/build-module/store/actions.js +0 -23
  78. package/build-module/store/actions.js.map +1 -1
  79. package/build-module/store/selectors.js +3 -80
  80. package/build-module/store/selectors.js.map +1 -1
  81. package/build-module/store/utils/notice-builder.js +15 -18
  82. package/build-module/store/utils/notice-builder.js.map +1 -1
  83. package/build-module/{store/utils → utils}/get-template-part-icon.js +2 -2
  84. package/build-module/utils/get-template-part-icon.js.map +1 -0
  85. package/build-module/utils/index.js +1 -0
  86. package/build-module/utils/index.js.map +1 -1
  87. package/build-style/style-rtl.css +6 -1
  88. package/build-style/style.css +6 -1
  89. package/package.json +28 -28
  90. package/src/components/autosave-monitor/index.js +5 -0
  91. package/src/components/autosave-monitor/test/index.js +10 -4
  92. package/src/components/character-count/index.js +3 -2
  93. package/src/components/editor-help/help-get-support-button.native.js +38 -0
  94. package/src/components/editor-help/index.native.js +130 -80
  95. package/src/components/editor-help/style.android.scss +6 -0
  96. package/src/components/editor-help/style.ios.scss +6 -0
  97. package/src/components/editor-help/style.scss +25 -0
  98. package/src/components/editor-help/test/index.native.js +80 -0
  99. package/src/components/entities-saved-states/entity-type-list.js +29 -10
  100. package/src/components/entities-saved-states/index.js +38 -8
  101. package/src/components/global-keyboard-shortcuts/save-shortcut.js +34 -42
  102. package/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +8 -16
  103. package/src/components/post-format/index.js +6 -2
  104. package/src/components/post-format/style.scss +1 -0
  105. package/src/components/post-locked-modal/index.js +1 -1
  106. package/src/components/post-saved-state/index.js +41 -55
  107. package/src/components/post-saved-state/style.scss +10 -1
  108. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +20 -0
  109. package/src/components/post-saved-state/test/index.js +2 -2
  110. package/src/components/post-taxonomies/flat-term-selector.js +220 -254
  111. package/src/components/post-title/index.js +5 -3
  112. package/src/components/provider/index.native.js +2 -0
  113. package/src/components/provider/use-block-editor-settings.js +24 -2
  114. package/src/components/word-count/index.js +3 -2
  115. package/src/store/actions.js +0 -28
  116. package/src/store/selectors.js +2 -105
  117. package/src/store/test/actions.js +4 -2
  118. package/src/store/utils/notice-builder.js +17 -19
  119. package/src/store/utils/test/notice-builder.js +1 -1
  120. package/src/{store/utils → utils}/get-template-part-icon.js +2 -2
  121. package/src/utils/index.js +1 -0
  122. package/build/store/utils/get-template-part-icon.js.map +0 -1
  123. package/build-module/store/utils/get-template-part-icon.js.map +0 -1
@@ -19,7 +19,7 @@ import { close as closeIcon } from '@wordpress/icons';
19
19
  */
20
20
  import EntityTypeList from './entity-type-list';
21
21
 
22
- const TRANSLATED_SITE_PROTPERTIES = {
22
+ const TRANSLATED_SITE_PROPERTIES = {
23
23
  title: __( 'Title' ),
24
24
  description: __( 'Tagline' ),
25
25
  site_logo: __( 'Logo' ),
@@ -27,6 +27,13 @@ const TRANSLATED_SITE_PROTPERTIES = {
27
27
  page_on_front: __( 'Page on front' ),
28
28
  };
29
29
 
30
+ const PUBLISH_ON_SAVE_ENTITIES = [
31
+ {
32
+ kind: 'postType',
33
+ name: 'wp_navigation',
34
+ },
35
+ ];
36
+
30
37
  export default function EntitiesSavedStates( { close } ) {
31
38
  const saveButtonRef = useRef();
32
39
  const { dirtyEntityRecords } = useSelect( ( select ) => {
@@ -49,7 +56,7 @@ export default function EntitiesSavedStates( { close } ) {
49
56
  siteEditsAsEntities.push( {
50
57
  kind: 'root',
51
58
  name: 'site',
52
- title: TRANSLATED_SITE_PROTPERTIES[ property ] || property,
59
+ title: TRANSLATED_SITE_PROPERTIES[ property ] || property,
53
60
  property,
54
61
  } );
55
62
  }
@@ -63,14 +70,27 @@ export default function EntitiesSavedStates( { close } ) {
63
70
  };
64
71
  }, [] );
65
72
  const {
73
+ editEntityRecord,
66
74
  saveEditedEntityRecord,
67
75
  __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,
68
76
  } = useDispatch( coreStore );
69
77
 
70
78
  // To group entities by type.
71
- const partitionedSavables = Object.values(
72
- groupBy( dirtyEntityRecords, 'name' )
73
- );
79
+ const partitionedSavables = groupBy( dirtyEntityRecords, 'name' );
80
+
81
+ // Sort entity groups.
82
+ const {
83
+ site: siteSavables,
84
+ wp_template: templateSavables,
85
+ wp_template_part: templatePartSavables,
86
+ ...contentSavables
87
+ } = partitionedSavables;
88
+ const sortedPartitionedSavables = [
89
+ siteSavables,
90
+ templateSavables,
91
+ templatePartSavables,
92
+ ...Object.values( contentSavables ),
93
+ ].filter( Array.isArray );
74
94
 
75
95
  // Unchecked entities to be ignored by save function.
76
96
  const [ unselectedEntities, _setUnselectedEntities ] = useState( [] );
@@ -118,6 +138,16 @@ export default function EntitiesSavedStates( { close } ) {
118
138
  if ( 'root' === kind && 'site' === name ) {
119
139
  siteItemsToSave.push( property );
120
140
  } else {
141
+ if (
142
+ PUBLISH_ON_SAVE_ENTITIES.some(
143
+ ( typeToPublish ) =>
144
+ typeToPublish.kind === kind &&
145
+ typeToPublish.name === name
146
+ )
147
+ ) {
148
+ editEntityRecord( kind, name, key, { status: 'publish' } );
149
+ }
150
+
121
151
  saveEditedEntityRecord( kind, name, key );
122
152
  }
123
153
  } );
@@ -160,15 +190,15 @@ export default function EntitiesSavedStates( { close } ) {
160
190
  </div>
161
191
 
162
192
  <div className="entities-saved-states__text-prompt">
163
- <strong>{ __( 'Select the changes you want to save' ) }</strong>
193
+ <strong>{ __( 'Are you ready to save?' ) }</strong>
164
194
  <p>
165
195
  { __(
166
- 'Some changes may affect other areas of your site.'
196
+ 'The following changes have been made to your site, templates, and content.'
167
197
  ) }
168
198
  </p>
169
199
  </div>
170
200
 
171
- { partitionedSavables.map( ( list ) => {
201
+ { sortedPartitionedSavables.map( ( list ) => {
172
202
  return (
173
203
  <EntityTypeList
174
204
  key={ list[ 0 ].name }
@@ -12,51 +12,43 @@ import { store as editorStore } from '../../store';
12
12
 
13
13
  function SaveShortcut( { resetBlocksOnSave } ) {
14
14
  const { resetEditorBlocks, savePost } = useDispatch( editorStore );
15
- const { isEditedPostDirty, getPostEdits } = useSelect( ( select ) => {
16
- const {
17
- isEditedPostDirty: _isEditedPostDirty,
18
- getPostEdits: _getPostEdits,
19
- } = select( editorStore );
20
-
21
- return {
22
- isEditedPostDirty: _isEditedPostDirty,
23
- getPostEdits: _getPostEdits,
24
- };
25
- }, [] );
26
-
27
- useShortcut(
28
- 'core/editor/save',
29
- ( event ) => {
30
- event.preventDefault();
31
-
32
- // TODO: This should be handled in the `savePost` effect in
33
- // considering `isSaveable`. See note on `isEditedPostSaveable`
34
- // selector about dirtiness and meta-boxes.
35
- //
36
- // See: `isEditedPostSaveable`
37
- if ( ! isEditedPostDirty() ) {
38
- return;
39
- }
15
+ const { isEditedPostDirty, getPostEdits, isPostSavingLocked } = useSelect(
16
+ editorStore
17
+ );
40
18
 
41
- // The text editor requires that editor blocks are updated for a
42
- // save to work correctly. Usually this happens when the textarea
43
- // for the code editors blurs, but the shortcut can be used without
44
- // blurring the textarea.
45
- if ( resetBlocksOnSave ) {
46
- const postEdits = getPostEdits();
47
- if (
48
- postEdits.content &&
49
- typeof postEdits.content === 'string'
50
- ) {
51
- const blocks = parse( postEdits.content );
52
- resetEditorBlocks( blocks );
53
- }
19
+ useShortcut( 'core/editor/save', ( event ) => {
20
+ event.preventDefault();
21
+
22
+ /**
23
+ * Do not save the post if post saving is locked.
24
+ */
25
+ if ( isPostSavingLocked() ) {
26
+ return;
27
+ }
28
+
29
+ // TODO: This should be handled in the `savePost` effect in
30
+ // considering `isSaveable`. See note on `isEditedPostSaveable`
31
+ // selector about dirtiness and meta-boxes.
32
+ //
33
+ // See: `isEditedPostSaveable`
34
+ if ( ! isEditedPostDirty() ) {
35
+ return;
36
+ }
37
+
38
+ // The text editor requires that editor blocks are updated for a
39
+ // save to work correctly. Usually this happens when the textarea
40
+ // for the code editors blurs, but the shortcut can be used without
41
+ // blurring the textarea.
42
+ if ( resetBlocksOnSave ) {
43
+ const postEdits = getPostEdits();
44
+ if ( postEdits.content && typeof postEdits.content === 'string' ) {
45
+ const blocks = parse( postEdits.content );
46
+ resetEditorBlocks( blocks );
54
47
  }
48
+ }
55
49
 
56
- savePost();
57
- },
58
- { bindGlobal: true }
59
- );
50
+ savePost();
51
+ } );
60
52
 
61
53
  return null;
62
54
  }
@@ -13,23 +13,15 @@ import { store as editorStore } from '../../store';
13
13
  function VisualEditorGlobalKeyboardShortcuts() {
14
14
  const { redo, undo } = useDispatch( editorStore );
15
15
 
16
- useShortcut(
17
- 'core/editor/undo',
18
- ( event ) => {
19
- undo();
20
- event.preventDefault();
21
- },
22
- { bindGlobal: true }
23
- );
16
+ useShortcut( 'core/editor/undo', ( event ) => {
17
+ undo();
18
+ event.preventDefault();
19
+ } );
24
20
 
25
- useShortcut(
26
- 'core/editor/redo',
27
- ( event ) => {
28
- redo();
29
- event.preventDefault();
30
- },
31
- { bindGlobal: true }
32
- );
21
+ useShortcut( 'core/editor/redo', ( event ) => {
22
+ redo();
23
+ event.preventDefault();
24
+ } );
33
25
 
34
26
  return <SaveShortcut />;
35
27
  }
@@ -6,7 +6,7 @@ import { find, get, includes, union } from 'lodash';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { __ } from '@wordpress/i18n';
9
+ import { __, sprintf } from '@wordpress/i18n';
10
10
  import { Button, SelectControl } from '@wordpress/components';
11
11
  import { useDispatch, useSelect } from '@wordpress/data';
12
12
  import { useInstanceId } from '@wordpress/compose';
@@ -107,7 +107,11 @@ export default function PostFormat() {
107
107
  onUpdatePostFormat( suggestion.id )
108
108
  }
109
109
  >
110
- { suggestion.caption }
110
+ { sprintf(
111
+ /* translators: %s: post format */
112
+ __( 'Apply format: %s' ),
113
+ suggestion.caption
114
+ ) }
111
115
  </Button>
112
116
  </div>
113
117
  ) }
@@ -12,6 +12,7 @@
12
12
  }
13
13
 
14
14
  .editor-post-format__suggestion {
15
+ padding: $grid-unit-15 * 0.5;
15
16
  text-align: right;
16
17
  font-size: $default-font-size;
17
18
  }
@@ -54,7 +54,7 @@ export default function PostLockedModal() {
54
54
  activePostLock: getActivePostLock(),
55
55
  postType: getPostType( getEditedPostAttribute( 'type' ) ),
56
56
  };
57
- } );
57
+ }, [] );
58
58
 
59
59
  useEffect( () => {
60
60
  /**
@@ -100,79 +100,65 @@ export default function PostSavedState( {
100
100
  return () => clearTimeout( timeoutId );
101
101
  }, [ isSaving ] );
102
102
 
103
- if ( isSaving ) {
104
- // TODO: Classes generation should be common across all return
105
- // paths of this function, including proper naming convention for
106
- // the "Save Draft" button.
107
- const classes = classnames(
108
- 'editor-post-saved-state',
109
- 'is-saving',
110
- getAnimateClassName( { type: 'loading' } ),
111
- {
112
- 'is-autosaving': isAutosaving,
113
- }
114
- );
115
-
116
- return (
117
- <span className={ classes }>
118
- <Icon icon={ cloud } />
119
- { isAutosaving ? __( 'Autosaving' ) : __( 'Saving' ) }
120
- </span>
121
- );
122
- }
123
-
124
- if ( isPublished || isScheduled ) {
125
- return <PostSwitchToDraftButton />;
126
- }
127
-
128
- if ( ! isSaveable ) {
129
- return null;
130
- }
131
-
132
- if ( forceSavedMessage || ( ! isNew && ! isDirty ) ) {
133
- return (
134
- <span className="editor-post-saved-state is-saved">
135
- <Icon icon={ check } />
136
- { __( 'Saved' ) }
137
- </span>
138
- );
139
- }
140
-
141
103
  // Once the post has been submitted for review this button
142
104
  // is not needed for the contributor role.
143
-
144
105
  if ( ! hasPublishAction && isPending ) {
145
106
  return null;
146
107
  }
147
108
 
109
+ if ( isPublished || isScheduled ) {
110
+ return <PostSwitchToDraftButton />;
111
+ }
112
+
148
113
  /* translators: button label text should, if possible, be under 16 characters. */
149
114
  const label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );
150
115
 
151
116
  /* translators: button label text should, if possible, be under 16 characters. */
152
117
  const shortLabel = __( 'Save' );
153
118
 
154
- if ( ! isLargeViewport ) {
155
- return (
156
- <Button
157
- className="editor-post-save-draft"
158
- label={ label }
159
- onClick={ () => savePost() }
160
- shortcut={ displayShortcut.primary( 's' ) }
161
- icon={ cloudUpload }
162
- >
163
- { showIconLabels && shortLabel }
164
- </Button>
165
- );
119
+ const isSaved = forceSavedMessage || ( ! isNew && ! isDirty );
120
+ const isSavedState = isSaving || isSaved;
121
+ const isDisabled = isSaving || isSaved || ! isSaveable;
122
+
123
+ let text;
124
+
125
+ if ( isSaving ) {
126
+ text = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );
127
+ } else if ( isSaved ) {
128
+ text = __( 'Saved' );
129
+ } else if ( isLargeViewport ) {
130
+ text = label;
131
+ } else if ( showIconLabels ) {
132
+ text = shortLabel;
166
133
  }
167
134
 
135
+ // Use common Button instance for all saved states so that focus is not
136
+ // lost.
168
137
  return (
169
138
  <Button
170
- className="editor-post-save-draft"
171
- onClick={ () => savePost() }
139
+ className={
140
+ isSaveable || isSaving
141
+ ? classnames( {
142
+ 'editor-post-save-draft': ! isSavedState,
143
+ 'editor-post-saved-state': isSavedState,
144
+ 'is-saving': isSaving,
145
+ 'is-autosaving': isAutosaving,
146
+ 'is-saved': isSaved,
147
+ [ getAnimateClassName( {
148
+ type: 'loading',
149
+ } ) ]: isSaving,
150
+ } )
151
+ : undefined
152
+ }
153
+ onClick={ isDisabled ? undefined : () => savePost() }
172
154
  shortcut={ displayShortcut.primary( 's' ) }
173
- variant="tertiary"
155
+ variant={ isLargeViewport ? 'tertiary' : undefined }
156
+ icon={ isLargeViewport ? undefined : cloudUpload }
157
+ label={ label }
158
+ aria-disabled={ isDisabled }
174
159
  >
175
- { label }
160
+ { isSavedState && <Icon icon={ isSaved ? check : cloud } /> }
161
+ { text }
176
162
  </Button>
177
163
  );
178
164
  }
@@ -7,6 +7,15 @@
7
7
  overflow: hidden;
8
8
  white-space: nowrap;
9
9
 
10
+ // The disabled version of the save state should be legible as an indicator.
11
+ &.is-saving[aria-disabled="true"],
12
+ &.is-saving[aria-disabled="true"]:hover,
13
+ &.is-saved[aria-disabled="true"],
14
+ &.is-saved[aria-disabled="true"]:hover {
15
+ background: transparent;
16
+ color: $gray-700;
17
+ }
18
+
10
19
  svg {
11
20
  display: inline-block;
12
21
  flex: 0 0 auto;
@@ -20,7 +29,7 @@
20
29
  text-indent: inherit;
21
30
 
22
31
  svg {
23
- margin-right: $grid-unit-05;
32
+ margin-right: 0;
24
33
  }
25
34
  }
26
35
  }
@@ -1,10 +1,30 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`PostSavedState returns a disabled button if the post is not saveable 1`] = `
4
+ <ForwardRef(Button)
5
+ aria-disabled={true}
6
+ icon={
7
+ <SVG
8
+ viewBox="0 0 24 24"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ >
11
+ <Path
12
+ d="M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"
13
+ />
14
+ </SVG>
15
+ }
16
+ label="Save draft"
17
+ shortcut="Ctrl+S"
18
+ />
19
+ `;
20
+
3
21
  exports[`PostSavedState returns a switch to draft link if the post is published 1`] = `<WithSelect(WithDispatch(PostSwitchToDraftButton)) />`;
4
22
 
5
23
  exports[`PostSavedState should return Save button if edits to be saved 1`] = `
6
24
  <ForwardRef(Button)
25
+ aria-disabled={false}
7
26
  className="editor-post-save-draft"
27
+ label="Save draft"
8
28
  onClick={[Function]}
9
29
  shortcut="Ctrl+S"
10
30
  variant="tertiary"
@@ -48,7 +48,7 @@ describe( 'PostSavedState', () => {
48
48
  expect( wrapper.text() ).toContain( 'Saving' );
49
49
  } );
50
50
 
51
- it( 'returns null if the post is not saveable', () => {
51
+ it( 'returns a disabled button if the post is not saveable', () => {
52
52
  useSelect.mockImplementation( () => ( {
53
53
  isDirty: false,
54
54
  isNew: true,
@@ -58,7 +58,7 @@ describe( 'PostSavedState', () => {
58
58
 
59
59
  const wrapper = shallow( <PostSavedState /> );
60
60
 
61
- expect( wrapper.type() ).toBeNull();
61
+ expect( wrapper ).toMatchSnapshot();
62
62
  } );
63
63
 
64
64
  it( 'returns a switch to draft link if the post is published', () => {