editor.js/test/cypress/fixtures/types/PartialBlockMutationEvent.ts
Peter Savchenko 922dfd8741
chore(api): blocks.update(id, data) method improved (#2443)
* add custom Chai assertion "be.calledWithBatchedEvents" for testing onchange

* chore(api): blocks.update(id, data) method improved

- `blocks.update(id, data)` now can accept partial data object — it will update only passed properties, others will remain the same.
- `blocks.update(id, data)` now will trigger onChange with only `block-change` event.
- `blocks.update(id, data)` will return a promise with BlockAPI object of changed block.

* fix tests

* Update blocks.cy.ts
2023-08-19 07:53:42 +03:00

17 lines
391 B
TypeScript

import { BlockMutationEvent, BlockMutationType } from '../../../../types';
/**
* Simplified version of the BlockMutationEvent with optional fields that could be used in tests
*/
export default interface PartialBlockMutationEvent {
/**
* Event type
*/
type?: BlockMutationType,
/**
* Details with partial properties
*/
detail?: Partial<BlockMutationEvent['detail']>
}