From dcf08164d588eee8267f4bc79caf1c2c048bb47d Mon Sep 17 00:00:00 2001 From: kumavis Date: Sat, 25 Apr 2020 06:05:30 +0800 Subject: [PATCH] test/unit/permissions - fix promise await timing (#8410) --- .../controllers/permissions/permissions-middleware-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/app/controllers/permissions/permissions-middleware-test.js b/test/unit/app/controllers/permissions/permissions-middleware-test.js index 2cabda60b..d443c0b01 100644 --- a/test/unit/app/controllers/permissions/permissions-middleware-test.js +++ b/test/unit/app/controllers/permissions/permissions-middleware-test.js @@ -536,7 +536,9 @@ describe('permissions middleware', function () { await permController.approvePermissionsRequest(approvedReq, ACCOUNT_ARRAYS.a) - // at this point, the permission should have been granted + // wait for permission to be granted + await pendingApproval + const perms = permController.permissions.getPermissionsForDomain(ORIGINS.a) assert.equal( @@ -551,8 +553,6 @@ describe('permissions middleware', function () { [CAVEATS.eth_accounts(ACCOUNT_ARRAYS.a)] ) - await pendingApproval - // we should also see the accounts on the response assert.ok( res.result && !res.error,