Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit b4c93c3

Browse files
sebgeelendmo-odoo
authored andcommitted
[FIX] JWEditor: Await the new stop event mutex + adapat some tests
1 parent 8a18335 commit b4c93c3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/core/src/JWEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export class JWEditor {
463463
* Stop this editor instance.
464464
*/
465465
async stop(): Promise<void> {
466-
this.nextEventMutex(async execCommand => {
466+
await this.nextEventMutex(async execCommand => {
467467
if (this.memory) {
468468
this.memory.create('stop');
469469
this.memory.switchTo('stop'); // Unfreeze the memory.

packages/plugin-dom-layout/test/DomLayout.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ describe('DomLayout', () => {
122122
hasError = true;
123123
expect(error.message).to.include('default');
124124
});
125-
await editor.stop();
125+
expect(hasError).to.equal(true);
126+
hasError = false;
127+
await editor.stop().catch(error => {
128+
hasError = true;
129+
expect(error.message).to.include('default');
130+
});
126131
expect(hasError).to.equal(true);
127132
});
128133
});
@@ -149,7 +154,12 @@ describe('DomLayout', () => {
149154
hasError = true;
150155
expect(error.message).to.include('default');
151156
});
152-
await editor.stop();
157+
expect(hasError).to.equal(true);
158+
hasError = false;
159+
await editor.stop().catch(error => {
160+
hasError = true;
161+
expect(error.message).to.include('default');
162+
});
153163
expect(hasError).to.equal(true);
154164
});
155165
it('should replace the target by the template (template as string)', async () => {

0 commit comments

Comments
 (0)