-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DDLS-371: Show primary email in admin for client assigned to non prim…
…ary (#1760) * Added endpoint for getting primary user account for deputy uid, updated client details page to use new endpoint if not primary deputy, added api unit test * Updated dto transformer to include primary flag and deputy uid. Added behat test * Refactored to account for new method made available in user repo
- Loading branch information
Showing
10 changed files
with
150 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ class UserControllerTest extends AbstractTestController | |
private static $deputy1; | ||
private static $admin1; | ||
private static $deputy2; | ||
private static $primaryUserAccount; | ||
private static $nonPrimaryUserAccount; | ||
private static $tokenAdmin; | ||
private static $tokenSuperAdmin; | ||
private static $tokenDeputy; | ||
|
@@ -29,6 +31,8 @@ public function setUp(): void | |
self::$deputy1 = self::fixtures()->getRepo('User')->findOneByEmail('[email protected]'); | ||
self::$admin1 = self::fixtures()->getRepo('User')->findOneByEmail('[email protected]'); | ||
self::$deputy2 = self::fixtures()->createUser(); | ||
self::$primaryUserAccount = self::fixtures()->getRepo('User')->findOneByEmail('[email protected]'); | ||
self::$nonPrimaryUserAccount = self::fixtures()->getRepo('User')->findOneByEmail('[email protected]'); | ||
|
||
self::fixtures()->flush()->clear(); | ||
} | ||
|
@@ -545,4 +549,19 @@ public function testAgreeTermsUse() | |
$this->assertTrue($deputy->getAgreeTermsUse()); | ||
$this->assertEquals(date('Y-m-d'), $deputy->getAgreeTermsUseDate()->format('Y-m-d')); | ||
} | ||
|
||
public function testGetPrimaryAccount() | ||
{ | ||
$url = '/user/get-primary-user-account/567890098765'; | ||
|
||
$data = $this->assertJsonRequest('GET', $url, [ | ||
'mustSucceed' => true, | ||
'assertResponseCode' => 200, | ||
'AuthToken' => self::$tokenAdmin, | ||
])['data']; | ||
|
||
$this->assertEquals('multi-client-primary-deputy', $data['lastname']); | ||
$this->assertEquals('[email protected]', $data['email']); | ||
$this->assertTrue($data['is_primary']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters