editor.js/test/cypress/support/index.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

37 lines
694 B
TypeScript

/**
* This file is processed and
* loaded automatically before the test files.
*
* This is a great place to put global configuration and
* behavior that modifies Cypress.
*/
import '@cypress/code-coverage/support';
import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector';
installLogsCollector();
/**
* File with the helpful commands
*/
import './commands';
/**
* File with custom assertions
*/
import './e2e';
import chaiSubset from 'chai-subset';
/**
* "containSubset" object properties matcher
*/
chai.use(chaiSubset);
/**
* Before-each hook for the cypress tests
*/
beforeEach((): void => {
cy.visit('test/cypress/fixtures/test.html');
});