mirror of
https://github.com/codex-team/editor.js
synced 2024-06-18 05:35:28 +02:00
just use closest and reduce waiting time in test
This commit is contained in:
parent
e1cc221b90
commit
7e8c8a32ef
|
@ -911,7 +911,7 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
return false;
|
||||
}
|
||||
|
||||
return (node as HTMLElement).dataset.mutationFree === 'true' || !!node.closest('[data-mutation-free="deep"]');
|
||||
return !!node.closest('[data-mutation-free="true"]');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ describe('onChange callback', () => {
|
|||
.get('div.ce-block')
|
||||
.click();
|
||||
|
||||
cy.wait(500).then(() => {
|
||||
cy.wait(200).then(() => {
|
||||
cy.get('@onChange').should('have.callCount', 0);
|
||||
});
|
||||
});
|
||||
|
@ -539,7 +539,7 @@ describe('onChange callback', () => {
|
|||
/**
|
||||
* Check that onChange callback was not called
|
||||
*/
|
||||
cy.wait(500).then(() => {
|
||||
cy.wait(200).then(() => {
|
||||
cy.get('@onChange').should('have.callCount', 0);
|
||||
});
|
||||
});
|
||||
|
@ -554,9 +554,9 @@ describe('onChange callback', () => {
|
|||
toolWrapper.appendChild(toolChild);
|
||||
|
||||
/**
|
||||
* Mark it as mutation-free with deep check
|
||||
* Mark it as mutation-free
|
||||
*/
|
||||
toolWrapper.dataset.mutationFree = 'deep';
|
||||
toolWrapper.dataset.mutationFree = 'true';
|
||||
|
||||
/**
|
||||
* Mock of tool with data-mutation-free attribute
|
||||
|
@ -606,7 +606,7 @@ describe('onChange callback', () => {
|
|||
/**
|
||||
* Check that onChange callback was not called
|
||||
*/
|
||||
cy.wait(500).then(() => {
|
||||
cy.wait(200).then(() => {
|
||||
cy.get('@onChange').should('have.callCount', 0);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue