Skip to content

Commit

Permalink
chore: Fix rebase issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tofumatt committed Oct 27, 2018
1 parent ec5bfb3 commit 861c00c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 157 deletions.
43 changes: 0 additions & 43 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,49 +557,6 @@ export function exitFormattedText() {
};
}

/**
* Returns an action object used to create a notice.
*
* @param {string} status The notice status.
* @param {WPElement} content The notice content.
* @param {?Object} options The notice options. Available options:
* `id` (string; default auto-generated)
* `isDismissible` (boolean; default `true`).
*
* @return {Object} Action object.
*/
export function createNotice( status, content, options = {} ) {
const {
id = uuid(),
isDismissible = true,
spokenMessage,
} = options;
return {
type: 'CREATE_NOTICE',
notice: {
id,
status,
content,
isDismissible,
spokenMessage,
},
};
}

/**
* Returns an action object used to remove a notice.
*
* @param {string} id The notice id.
*
* @return {Object} Action object.
*/
export function removeNotice( id ) {
return {
type: 'REMOVE_NOTICE',
noticeId: id,
};
}

/**
* Returns an action object used to lock the editor.
*
Expand Down
114 changes: 0 additions & 114 deletions packages/editor/src/store/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import {
replaceBlocks,
startTyping,
stopTyping,
createNotice,
createErrorNotice,
createInfoNotice,
createSuccessNotice,
createWarningNotice,
removeNotice,
enterFormattedText,
exitFormattedText,
fetchReusableBlocks,
Expand Down Expand Up @@ -368,114 +362,6 @@ describe( 'actions', () => {
} );
} );

describe( 'createNotice', () => {
const status = 'status';
const content = <p>element</p>;
it( 'should return CREATE_NOTICE action when options is empty', () => {
const result = createNotice( status, content );
expect( result ).toMatchObject( {
type: 'CREATE_NOTICE',
notice: {
status,
content,
isDismissible: true,
id: expect.any( String ),
},
} );
} );
it( 'should return CREATE_NOTICE action when options is desined', () => {
const id = 'my-id';
const options = {
id,
isDismissible: false,
};
const result = createNotice( status, content, options );
expect( result ).toEqual( {
type: 'CREATE_NOTICE',
notice: {
id,
status,
content,
isDismissible: false,
},
} );
} );
} );

describe( 'createSuccessNotice', () => {
it( 'should return CREATE_NOTICE action', () => {
const content = <p>element</p>;
const result = createSuccessNotice( content );
expect( result ).toMatchObject( {
type: 'CREATE_NOTICE',
notice: {
status: 'success',
content,
isDismissible: true,
id: expect.any( String ),
},
} );
} );
} );

describe( 'createInfoNotice', () => {
it( 'should return CREATE_NOTICE action', () => {
const content = <p>element</p>;
const result = createInfoNotice( content );
expect( result ).toMatchObject( {
type: 'CREATE_NOTICE',
notice: {
status: 'info',
content,
isDismissible: true,
id: expect.any( String ),
},
} );
} );
} );

describe( 'createErrorNotice', () => {
it( 'should return CREATE_NOTICE action', () => {
const content = <p>element</p>;
const result = createErrorNotice( content );
expect( result ).toMatchObject( {
type: 'CREATE_NOTICE',
notice: {
status: 'error',
content,
isDismissible: true,
id: expect.any( String ),
},
} );
} );
} );

describe( 'createWarningNotice', () => {
it( 'should return CREATE_NOTICE action', () => {
const content = <p>element</p>;
const result = createWarningNotice( content );
expect( result ).toMatchObject( {
type: 'CREATE_NOTICE',
notice: {
status: 'warning',
content,
isDismissible: true,
id: expect.any( String ),
},
} );
} );
} );

describe( 'removeNotice', () => {
it( 'should return REMOVE_NOTICE actions', () => {
const noticeId = 'id';
expect( removeNotice( noticeId ) ).toEqual( {
type: 'REMOVE_NOTICE',
noticeId,
} );
} );
} );

describe( 'fetchReusableBlocks', () => {
it( 'should return the FETCH_REUSABLE_BLOCKS action', () => {
expect( fetchReusableBlocks() ).toEqual( {
Expand Down

0 comments on commit 861c00c

Please sign in to comment.