Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

[SMD-697] ID tags for testing #142

Merged
merged 1 commit into from
May 24, 2024
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
2 changes: 1 addition & 1 deletion app/templates/main/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2 class="govuk-heading-m">All funds ({{ authorised_funds | length }})</h2>

<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<a class="govuk-heading-m govuk-link--no-visited-state" href={{ url_for('main.upload', fund_code=fund_code, round=fund.current_reporting_round) }}> {{ fund.fund_name }}</a>
<a class="govuk-heading-m govuk-link--no-visited-state" id="{{ fund_code }}"href={{ url_for('main.upload', fund_code=fund_code, round=fund.current_reporting_round) }}> {{ fund.fund_name }}</a>
<p class="govuk-body"><b>Local Authority</b></p>
<p class="govuk-body"><b>Reporting Period</b></p>
</dt>
Expand Down
3 changes: 2 additions & 1 deletion app/templates/main/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@

{{ govukButton({
"element": "button",
"text": "Upload and check for errors"})
"text": "Upload and check for errors",
"id":"upload-button"})
}}
</form>
{{ helpLinksDropdown() }}
Expand Down
3 changes: 2 additions & 1 deletion app/templates/main/validation-errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ <h2 class="govuk-heading-l">Errors fixed?</h2>

{{ govukButton({
"element": "button",
"text": "Upload and check for errors"})
"text": "Upload and check for errors",
"id":"upload-button"})
}}

</form>
Expand Down
22 changes: 13 additions & 9 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ def test_select_fund_page_with_tf_role(flask_test_client, mocker):
response = flask_test_client.get("/dashboard")
page_html = BeautifulSoup(response.data)
assert response.status_code == 200
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/TF/5"> Towns Fund</a>' in str(
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/TF/5" id="TF"> Towns Fund</a>' in str(
page_html
)
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/PF/1"> Pathfinders</a>' not in str(
page_html
assert (
'<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/PF/1" id="PF"> Pathfinders</a>'
not in str(page_html)
)


Expand All @@ -34,10 +35,12 @@ def test_select_fund_page_with_pf_role(flask_test_client, mocked_pf_auth):
assert response.status_code == 200
page_html = BeautifulSoup(response.data)
assert (
'<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/TF/5"> Towns Fund</a>' not in page_html
'<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/TF/5" id="TF"> Towns Fund</a>'
not in page_html
)
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/PF/1"> Pathfinders</a>' in str(
page_html
assert (
'<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/PF/1" id="PF"> Pathfinders</a>'
in str(page_html)
)


Expand All @@ -46,11 +49,12 @@ def test_select_fund_page_with_tf_and_pf_roles(flask_test_client, mocked_pf_and_
response = flask_test_client.get("/dashboard")
page_html = BeautifulSoup(response.data)
assert response.status_code == 200
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/TF/5"> Towns Fund</a>' in str(
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/TF/5" id="TF"> Towns Fund</a>' in str(
page_html
)
assert '<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/PF/1"> Pathfinders</a>' in str(
page_html
assert (
'<a class="govuk-heading-m govuk-link--no-visited-state" href="/upload/PF/1" id="PF"> Pathfinders</a>'
in str(page_html)
)


Expand Down
Loading