From 0c5c63833406bd623096464ceba4566ef110a896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Thu, 9 Feb 2023 11:20:36 +0100 Subject: [PATCH] Convert the signal to a promise prior to carrying the action triggering the signal --- packages/filebrowser/test/listing.spec.ts | 6 ++++-- yarn.lock | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/filebrowser/test/listing.spec.ts b/packages/filebrowser/test/listing.spec.ts index 848a8b4bbbb2..18a8a030659b 100644 --- a/packages/filebrowser/test/listing.spec.ts +++ b/packages/filebrowser/test/listing.spec.ts @@ -215,16 +215,18 @@ describe('filebrowser/listing', () => { itemNode ) as HTMLInputElement; const item = dirListing.sortedItems().next(); + const waitForUpdate = signalToPromise(dirListing.updated); await dirListing.selectItemByName(item.value.name); - await signalToPromise(dirListing.updated); + await waitForUpdate; expect(checkbox.checked).toBe(true); expect(dirListing.isSelected(item.value.name)).toBe(true); + const waitForUpdate2 = signalToPromise(dirListing.updated); simulate(checkbox, 'mousedown', { clientX: 1, clientY: 1, button: 2 }); - await signalToPromise(dirListing.updated); + await waitForUpdate2; // Item is still selected and checkbox is still checked after // right-click. expect(dirListing.isSelected(item.value.name)).toBe(true); diff --git a/yarn.lock b/yarn.lock index 7d00be90a11e..436b650d4588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10135,7 +10135,7 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qs@6.11.0, qs@^6.4.0: +qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==