Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2022-08-03 17:37:06 +0300
committerGitHub <noreply@github.com>2022-08-03 17:37:06 +0300
commit02e2f82e3bb5d5be884bc3bc875ccf92473f8629 (patch)
tree93504e1aa21521cd3c06d6c26db6093064df340f /plugins/TwoFactorAuth
parent11d2db020381ad2bdeedb006e380dae5f56b920f (diff)
Require password confirmation when removing users through UI (#19586)
* Require password confirmation when removing users * add changelog * require password only for session auth * scroll to success notification * update UI tests * fix no button class * updates expected test files * fix UI test
Diffstat (limited to 'plugins/TwoFactorAuth')
-rw-r--r--plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php4
-rw-r--r--plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js5
-rw-r--r--plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png4
3 files changed, 7 insertions, 6 deletions
diff --git a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php
index 7291082949..e27c36e9de 100644
--- a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php
+++ b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php
@@ -132,7 +132,7 @@ class TwoFactorAuthTest extends IntegrationTestCase
{
$this->assertNotEmpty($this->dao->getAllRecoveryCodesForLogin($this->userWith2Fa));
Request::processRequest('UsersManager.deleteUser', array(
- 'userLogin' => $this->userWith2Fa
+ 'userLogin' => $this->userWith2Fa,
));
$this->assertEmpty($this->dao->getAllRecoveryCodesForLogin($this->userWith2Fa));
}
@@ -141,7 +141,7 @@ class TwoFactorAuthTest extends IntegrationTestCase
{
$this->expectNotToPerformAssertions();
Request::processRequest('UsersManager.deleteUser', array(
- 'userLogin' => $this->userWithout2Fa
+ 'userLogin' => $this->userWithout2Fa,
));
}
diff --git a/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js b/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js
index 413095db28..c4523915bc 100644
--- a/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js
+++ b/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js
@@ -49,8 +49,9 @@ describe("TwoFactorAuthUsersManager", function () {
it('should be possible to confirm the reset', async function () {
await page.type('.confirm-password-modal input[name=currentUserPassword]', 'superUserPass');
- await page.click('.confirm-password-modal .modal-close:not(.modal-no)');
- await page.waitForTimeout(500); // wait for modal to close
+ await (await page.jQuery('.confirm-password-modal .modal-close:not(.modal-no):visible')).click();
+ await page.waitForNetworkIdle();
+ await page.waitForTimeout(100); // wait for modal to close
expect(await page.screenshotSelector('#content,#notificationContainer')).to.matchImage('edit_with_2fa_reset_confirmed');
});
diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png
index 8ef4977984..0115123a78 100644
--- a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png
+++ b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2a1471265edf1370c634f5ecd2a6c8b8ff1f182304d9b06f5bcf3d578096eb67
-size 11910
+oid sha256:778146f4c64a9e6d168cd1acc981808f78e938fdce5bfecda4e21a9307d09729
+size 12094