Skip to content

Commit

Permalink
Revert "fixing tests"
Browse files Browse the repository at this point in the history
This reverts commit 0144c9b.
  • Loading branch information
nickdavis2001 committed Dec 9, 2024
1 parent 0144c9b commit c6dcef3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 36 deletions.
31 changes: 11 additions & 20 deletions service-front/app/features/context/UI/ViewerContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,11 @@ public function iChooseToDownloadADocumentVersionOfTheLPA()
'expires' => (new DateTime('+30 days'))->format('c'),
];

if (($this->base->container->get(FeatureEnabled::class))('instructions_and_preferences')) {
$data['iap'] = [
'uId' => (int) $this->lpaData['uId'],
'status' => $this->imageCollectionStatus,
'signedUrls' => [],
];
}
$data['iap'] = [
'uId' => (int) $this->lpaData['uId'],
'status' => $this->imageCollectionStatus,
'signedUrls' => [],
];

// API call for lpa full fetch
$this->apiFixtures->append(
Expand Down Expand Up @@ -532,7 +530,6 @@ public function iEnterAnOrganisationNameAndConfirmTheLPAIsCorrect()

if (
($data['lpa']['applicationHasGuidance'] ?? false) || ($data['lpa']['applicationHasRestrictions'] ?? false)
&& ($this->base->container->get(FeatureEnabled::class))('instructions_and_preferences')
) {
$data['iap'] = [
'uId' => (int) $this->lpaData['uId'],
Expand Down Expand Up @@ -783,10 +780,8 @@ public function iGiveAValidLPAShareCodeOf(string $code, string $storedCode)
public function iCanClearlySeeTheLPAHasInstructionsAndPreferences()
{
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has preferences and instructions');
if (($this->base->container->get(FeatureEnabled::class))('instructions_and_preferences')) {
$this->ui->assertElementOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementOnPage('iap-preferences img.opg-ip__image');
}
$this->ui->assertElementOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementOnPage('iap-preferences img.opg-ip__image');
}

/**
Expand All @@ -795,10 +790,8 @@ public function iCanClearlySeeTheLPAHasInstructionsAndPreferences()
public function iCanClearlySeeTheLPAHasPreferences()
{
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has preferences');
if (($this->base->container->get(FeatureEnabled::class))('instructions_and_preferences')) {
$this->ui->assertElementNotOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementOnPage('iap-preferences img.opg-ip__image');
}
$this->ui->assertElementNotOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementOnPage('iap-preferences img.opg-ip__image');
}

/**
Expand All @@ -807,10 +800,8 @@ public function iCanClearlySeeTheLPAHasPreferences()
public function iCanClearlySeeTheLPAHasInstructions()
{
$this->ui->assertElementContainsText('div.govuk-panel', 'This LPA has instructions');
if (($this->base->container->get(FeatureEnabled::class))('instructions_and_preferences')) {
$this->ui->assertElementOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementNotOnPage('iap-preferences img.opg-ip__image');
}
$this->ui->assertElementOnPage('iap-instructions img.opg-ip__image');
$this->ui->assertElementNotOnPage('iap-preferences img.opg-ip__image');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,12 @@
{% trans %}<abbr title="lasting power of attorney">LPA</abbr> details{% endtrans %}
</h2>

{% if feature_enabled("instructions_and_preferences") %}
{% include '@partials/lpa-summary-details/iap-images-components.html.twig' %}
<iap-images>
{% endif %}
{% include '@partials/lpa-summary-details/iap-images-components.html.twig' %}
<iap-images>

{% include '@partials/lpa-summary-details/lpa-details-combined-lpa.html.twig' %}

{% if feature_enabled("instructions_and_preferences") and iap_images is defined %}
{% if iap_images is defined %}
{% if iap_images.status is not constant('\\Common\\Entity\\InstructionsAndPreferences\\ImagesStatus::COLLECTION_ERROR') %}
<div class="govuk-inset-text">
{% trans %}If any scanned images are not readable, ask the person who gave you the access
Expand All @@ -124,9 +122,7 @@
{% endif %}
{% endif %}

{% if feature_enabled("instructions_and_preferences") %}
</iap-images>
{% endif %}
</iap-images>

<dl class="govuk-summary-list govuk-summary-list--no-border">
<div class="govuk-summary-list__row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,12 @@
{% trans %}<abbr title="lasting power of attorney">LPA</abbr> details{% endtrans %}
</h2>

{% if feature_enabled("instructions_and_preferences") %}
{% include '@partials/lpa-summary-details/iap-images-components.html.twig' %}
<iap-images>
{% endif %}
{% include '@partials/lpa-summary-details/iap-images-components.html.twig' %}
<iap-images>

{% include '@partials/lpa-summary-details/lpa-details.html.twig' %}

{% if feature_enabled("instructions_and_preferences") and iap_images is defined %}
{% if iap_images is defined %}
{% if iap_images.status is not constant('\\Common\\Entity\\InstructionsAndPreferences\\ImagesStatus::COLLECTION_ERROR') %}
<div class="govuk-inset-text">
{% trans %}If any scanned images are not readable, ask the person who gave you the access
Expand All @@ -124,9 +122,7 @@
{% endif %}
{% endif %}

{% if feature_enabled("instructions_and_preferences") %}
</iap-images>
{% endif %}
</iap-images>

<dl class="govuk-summary-list govuk-summary-list--no-border">
<div class="govuk-summary-list__row">
Expand Down

0 comments on commit c6dcef3

Please sign in to comment.