Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into UML-3394-combined-lpa-manager
Browse files Browse the repository at this point in the history
# Conflicts:
#	service-front/app/src/Common/src/Service/Lpa/ParseLpaData.php
  • Loading branch information
cooperaj committed Jan 17, 2025
2 parents 941a6e6 + 38c7bd6 commit 45a82eb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
12 changes: 12 additions & 0 deletions service-front/app/features/actor-remove-lpa.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,15 @@ Feature: Remove an LPA from my account
Given I am on the dashboard page
When I request to remove an LPA from my account without the lpa actor token
Then I should be shown an error page

@ui
Scenario: The user can remove their LPA from their account when no active attorneys on LPA
Given I am on the dashboard page
When I request to remove an LPA from my account that has no active attorney on it
And I confirm that I want to remove the LPA from my account
Then The LPA is removed
And I am taken back to the dashboard page
And I cannot see my LPA on the dashboard
And I can see a flash message confirming that my LPA has been removed


26 changes: 26 additions & 0 deletions service-front/app/features/context/UI/LpaContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,32 @@ public function iRequestToRemoveAnLPAFromMyAccountThatIs($status): void
$this->ui->assertPageAddress('/lpa/remove-lpa');
}

/**
* @When /^I request to remove an LPA from my account that has no active attorney on it$/
*/
public function iRequestToRemoveAnLPAFromMyAccountThatHasNoActiveAttorneysOnIt(): void
{
$this->lpa->status = 'Registered';

// API call for get LpaById
$this->apiFixtures->append(
ContextUtilities::newResponse(
StatusCodeInterface::STATUS_OK,
json_encode(
[
'user-lpa-actor-token' => $this->userLpaActorToken,
'date' => 'date',
'lpa' => $this->lpa,
'actor' => null,
]
),
self::LPA_SERVICE_GET_LPA_BY_ID
)
);
$this->ui->clickLink('Remove LPA');
$this->ui->assertPageAddress('/lpa/remove-lpa');
}

/**
* @When /^I request to view an LPA which has a donor signature before 2016$/
* @When /^I request to view an LPA which has a trust corporation added$/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getLpaById(string $userToken, string $actorLpaToken): ?ArrayObje

$lpaData = $this->apiClient->httpGet('/v1/lpas/' . $actorLpaToken);

$lpaData = isset($lpaData['actor']) ? ($this->parseLpaData)($lpaData) : null;
$lpaData = ($this->parseLpaData)($lpaData);

if ($lpaData['lpa'] !== null) {
$this->logger->info(
Expand Down

0 comments on commit 45a82eb

Please sign in to comment.