Skip to content

Commit

Permalink
INT-3299: use a pTryUntil instead of waitForEditorsToLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
danoaky-tiny committed Jun 18, 2024
1 parent 14f2157 commit 91df0b0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tinymce-angular-component/src/test/ts/browser/PropTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { By } from '@angular/platform-browser';
import { Editor } from 'tinymce';
import { expect } from 'chai';
import { Fun } from '@ephox/katamari';
import { Waiter } from '@ephox/agar';

describe('PropTest', () => {
const containsIDWarning = (logs: unknown[][]) =>
Expand Down Expand Up @@ -101,14 +102,16 @@ describe('PropTest', () => {
initialValue: `text${i}`,
}));
fixture.detectChanges();
const [ ed1, ed2, ed3, ed4 ] = await waitForEditorsToLoad(fixture);
expect(ed1.id).to.equal('my-id-0');
expect(ed1.getContent()).to.equal('<p>text0</p>');
expect(ed2.id).to.equal('my-id-1');
expect(ed2.getContent()).to.equal('<p>text1</p>');
expect(ed3.id).to.equal('my-id-2');
expect(ed3.getContent()).to.equal('<p>text2</p>');
expect(ed4).to.be.undefined;
const [ ed1, ed2, ed3, ed4 ] = findAllComponents(fixture, EditorComponent);
await Waiter.pTryUntil('All editors to have been initialised', () => {
expect(ed1.id).to.equal('my-id-0');
expect(ed1.editor?.getContent()).to.equal('<p>text0</p>');
expect(ed2.id).to.equal('my-id-1');
expect(ed2.editor?.getContent()).to.equal('<p>text1</p>');
expect(ed3.id).to.equal('my-id-2');
expect(ed3.editor?.getContent()).to.equal('<p>text2</p>');
expect(ed4?.editor).to.be.undefined;
}, 1000, 10000);
});
expect(containsIDWarning(warnings), 'Should not contain an ID warning').to.be.false;
});
Expand Down

0 comments on commit 91df0b0

Please sign in to comment.