Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions features/static.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
Feature: Static Pages
Scenario: The static pages are available without logging in
When I go to "/cookies"
Then I see a page title "NHS check if you need a lung scan cookies policy"
Then I see a phase header "Pilot"
And I see a link named "feedback"
And I see a page title "NHS check if you need a lung scan cookies policy"
When I go to "/privacy-policy"
Then I see a page title "NHS check if you need a lung scan privacy policy"
Then I see a phase header "Pilot"
And I see a link named "feedback"
And I see a page title "NHS check if you need a lung scan privacy policy"

Scenario: The static pages are available when logged in and accessible
Given I am logged in
When I go to "/cookies"
Then there are no accessibility violations
Then I see a phase header "Pilot"
And I see a link named "feedback"
And there are no accessibility violations
And I see a page title "NHS check if you need a lung scan cookies policy"
When I go to "/privacy-policy"
Then there are no accessibility violations
Then I see a phase header "Pilot"
And I see a link named "feedback"
And there are no accessibility violations
And I see a page title "NHS check if you need a lung scan privacy policy"
10 changes: 10 additions & 0 deletions features/steps/page_assertion_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ def then_i_see_a_back_link_to(context, url):
@then(u'I see a page title "{title}"')
def then_i_see_a_page_title(context, title):
expect(context.page.locator('h1')).to_have_text(title)

@then(u'I see a phase header "{phase}"')
def then_i_see_a_phase_header(context, phase):
expect(context.page.locator('.lung-nhsuk-phase-banner__text')).to_have_count(1)
expect(context.page.locator('.lung-nhsuk-phase-banner__content .nhsuk-tag')).to_have_text(phase)

@then(u'I see a link named "{link_text}"')
def then_i_see_a_link_named(context, link_text):
link = context.page.locator(f'a:has-text("{link_text}")')
expect(link).to_have_count(1)
16 changes: 16 additions & 0 deletions lung_cancer_screening/assets/sass/components/_phase_banner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.lung-nhsuk-phase-banner__container{
border-bottom: 1px solid var(--nhsuk-grey-3-colour);
padding-bottom: 10px;
padding-top: 10px;
}

.lung-nhsuk-phase-banner__content {
display: table;
margin: 0;
}

.lung-nhsuk-phase-banner__text {
display: table-cell;
vertical-align: middle;
padding-left: 10px;
}
1 change: 1 addition & 0 deletions lung_cancer_screening/assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
// Components that are not in the NHS.UK frontend library
@forward "components/multi_field_input";

@forward 'components/phase_banner';
@forward "components/numbered_lists"
3 changes: 3 additions & 0 deletions lung_cancer_screening/core/jinja2/layout.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
] if request.user.is_authenticated else []
}
}) }}

{% include 'phase_banner.jinja' %}

{% endblock header %}

{% block beforeContent %}
Expand Down
13 changes: 13 additions & 0 deletions lung_cancer_screening/core/jinja2/phase_banner.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<section role="region" aria-label="Service phase" class="nhsuk-width-container">
<div class="lung-nhsuk-phase-banner__container">
<div class="nhsuk-phase-banner">
<p class="lung-nhsuk-phase-banner__content">
<span class="nhsuk-tag nhsuk-tag__content nhsuk-tag--blue">Pilot</span>
<span class="lung-nhsuk-phase-banner__text nhsuk-body-s">
We are testing a new service &ndash; your <a
href="https://feedback.digital.nhs.uk/jfe/form/SV_6V8dAlFT0sxJnzo" target="_blank"
rel="noopener">feedback</a> will help us improve it.</span>
</p>
</div>
</div>
</section>
Loading