Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed May 26, 2021
1 parent 62975ad commit 0909598
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function* resetAutosave( newAutosave ) {

const postId = yield controls.select( STORE_NAME, 'getCurrentPostId' );
yield controls.dispatch(
coreStore,
coreStore.name,
'receiveAutosaves',
postId,
newAutosave
Expand Down Expand Up @@ -203,7 +203,7 @@ export function setupEditorState( post ) {
export function* editPost( edits, options ) {
const { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );
yield controls.dispatch(
coreStore,
coreStore.name,
'editEntityRecord',
'postType',
type,
Expand Down Expand Up @@ -239,7 +239,7 @@ export function* savePost( options = {} ) {
edits = {
id: previousRecord.id,
...( yield controls.select(
coreStore,
coreStore.name,
'getEntityRecordNonTransientEdits',
'postType',
previousRecord.type,
Expand All @@ -248,7 +248,7 @@ export function* savePost( options = {} ) {
...edits,
};
yield controls.dispatch(
coreStore,
coreStore.name,
'saveEntityRecord',
'postType',
previousRecord.type,
Expand All @@ -258,7 +258,7 @@ export function* savePost( options = {} ) {
yield __experimentalRequestPostUpdateFinish( options );

const error = yield controls.select(
coreStore,
coreStore.name,
'getLastEntitySaveError',
'postType',
previousRecord.type,
Expand Down Expand Up @@ -286,7 +286,7 @@ export function* savePost( options = {} ) {
previousPost: previousRecord,
post: updatedRecord,
postType: yield controls.resolveSelect(
coreStore,
coreStore.name,
'getPostType',
updatedRecord.type
),
Expand All @@ -303,7 +303,7 @@ export function* savePost( options = {} ) {
// considered for change detection.
if ( ! options.isAutosave ) {
yield controls.dispatch(
blockEditorStore,
blockEditorStore.name,
'__unstableMarkLastChangeAsPersistent'
);
}
Expand All @@ -320,7 +320,7 @@ export function* refreshPost() {
'getCurrentPostType'
);
const postType = yield controls.resolveSelect(
coreStore,
coreStore.name,
'getPostType',
postTypeSlug
);
Expand All @@ -343,7 +343,7 @@ export function* trashPost() {
'getCurrentPostType'
);
const postType = yield controls.resolveSelect(
coreStore,
coreStore.name,
'getPostType',
postTypeSlug
);
Expand Down Expand Up @@ -422,7 +422,7 @@ export function* autosave( { local = false, ...options } = {} ) {
* @yield {Object} Action object.
*/
export function* redo() {
yield controls.dispatch( coreStore, 'redo' );
yield controls.dispatch( coreStore.name, 'redo' );
}

/**
Expand All @@ -431,7 +431,7 @@ export function* redo() {
* @yield {Object} Action object.
*/
export function* undo() {
yield controls.dispatch( coreStore, 'undo' );
yield controls.dispatch( coreStore.name, 'undo' );
}

/**
Expand Down Expand Up @@ -611,15 +611,15 @@ export function* resetEditorBlocks( blocks, options = {} ) {
);
const noChange =
( yield controls.select(
coreStore,
coreStore.name,
'getEditedEntityRecord',
'postType',
type,
id
) ).blocks === edits.blocks;
if ( noChange ) {
return yield controls.dispatch(
coreStore,
coreStore.name,
'__unstableCreateUndoLevel',
'postType',
type,
Expand Down Expand Up @@ -661,7 +661,7 @@ const getBlockEditorAction = ( name ) =>
alternative:
"`wp.data.dispatch( 'core/block-editor' )." + name + '`',
} );
yield controls.dispatch( blockEditorStore, name, ...args );
yield controls.dispatch( blockEditorStore.name, name, ...args );
};

/**
Expand Down

0 comments on commit 0909598

Please sign in to comment.