Skip to content

Commit 62b5c1b

Browse files
committed
test: đź’Ť fix race condition in copy button test
1 parent 8105022 commit 62b5c1b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎addons/rose/tests/integration/components/rose/code-editor/toolbar-test.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ module('Integration | Component | rose/code-editor/toolbar', function (hooks) {
4343
});
4444

4545
test('it calls onCopy callback', async function (assert) {
46+
const { promise: onCopyPromise, resolve } = Promise.withResolvers();
4647
const onCopy = () => {
48+
resolve();
4749
this.set('called', true);
4850
};
4951
this.set('onCopy', onCopy);
@@ -55,6 +57,7 @@ module('Integration | Component | rose/code-editor/toolbar', function (hooks) {
5557
assert.dom(menuDividerSelector).doesNotExist();
5658

5759
await click(copyButtonSelector);
60+
await onCopyPromise;
5861
assert.true(this.called);
5962
});
6063
});

0 commit comments

Comments
 (0)