Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Support and Advice in Find for TDA courses #4876

Merged
merged 3 commits into from
Feb 6, 2025
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
3 changes: 2 additions & 1 deletion app/assets/stylesheets/components/_advice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
margin-bottom: 0;
}

#section-advice-and-support {
#section-advice-and-support,
#section-tda-advice {
Comment on lines +19 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use classes for styling instead of IDs please?

border: 5px solid govuk-colour("pink");
margin-bottom: 30px;
padding: 20px;
Expand Down
9 changes: 9 additions & 0 deletions app/views/find/courses/_tda_advice.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="section-tda-advice">
<h2 class="govuk-heading-m" id="section-advice"><%= t(".heading") %></h2>
<div class="govuk-body">
<%= t(".content") %>
</div>
<div class="govuk-body">
<%= govuk_link_to(t(".link_text"), t("find.get_into_teaching.url_tda")) %>
</div>
</div>
6 changes: 5 additions & 1 deletion app/views/find/courses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@
</p>
<% end %>

<%= render partial: "find/courses/advice", locals: { course: @course } %>
<% if @course.teacher_degree_apprenticeship? %>
<%= render partial: "find/courses/tda_advice" %>
<% else %>
<%= render partial: "find/courses/advice", locals: { course: @course } %>
<% end %>

<% if @course.application_status_closed? %>
<%= render partial: "find/courses/course_closed" %>
Expand Down
4 changes: 4 additions & 0 deletions config/locales/find.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ en:
uk_citizens: UK citizens
non_uk_citizens: Non-UK citizens
course_fees: The course fees for UK citizens in %{cycle_range} are %{fee}.
tda_advice:
heading: Teacher degree apprenticeships (TDAs)
content: On a teacher degree apprenticeship you’ll work in a school and earn a salary while getting a bachelor’s degree and qualified teacher status (QTS).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a similar content on, can we use?

232: tda_with_qts_content_html: On a teacher degree apprenticeship you’ll work in a school and earn a salary while getting a bachelor’s degree and qualified teacher status (QTS). %{tda_link}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're in different components. I don't think it's worth the effort to make them the same value. They could easily change and that would be harder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the text belongs to the components, let's keep them separate.

link_text: Find out more about teacher degree apprenticeships.
advice:
heading: Support and advice
postgraduate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@
scenario 'user visits get into teaching advice page' do
given_there_is_a_findable_undergraduate_course
when_i_visit_the_course_page
and_i_click_to_contact_get_into_teaching
then_i_see_the_tda_advice_callout
and_i_do_not_see_the_support_and_advice_callout
when_i_click_to_contact_get_into_teaching
then_i_am_redirected_to_the_git_help_and_support_page
end

def given_there_is_a_findable_undergraduate_course
user = create(:user, providers: [build(:provider, provider_type: 'lead_school', sites: [build(:site), build(:site)], study_sites: [build(:site, :study_site), build(:site, :study_site)])])
provider = user.providers.first
create(:provider, :accredited_provider, provider_code: '1BK')
accredited_provider = create(:provider, :accredited_provider, provider_code: '1BJ')
provider.accrediting_provider_enrichments = []
provider.accrediting_provider_enrichments << AccreditingProviderEnrichment.new(
{
UcasProviderCode: accredited_provider.provider_code,
Description: 'description'
}
)
@course = create(:course, :published_teacher_degree_apprenticeship, :secondary, provider:, name: 'Biology', subjects: [find_or_create(:secondary_subject, :biology)])
end

Expand All @@ -42,15 +36,22 @@ def when_i_visit_the_course_page
)
end

def and_i_click_to_contact_get_into_teaching
expect(page).to have_content('Support and advice')
expect(page).to have_content('You can contact Get Into Teaching for free support')
click_link_or_button('contact Get Into Teaching')
def then_i_see_the_tda_advice_callout
expect(find_course_show_page.course_tda_advice).to have_css(:h2, text: 'Teacher degree apprenticeship')
expect(find_course_show_page.course_tda_advice).to have_content('On a teacher degree apprenticeship you’ll work in a school and earn a salary while getting a bachelor’s degree and qualified teacher status (QTS).')
end

def and_i_do_not_see_the_support_and_advice_callout
expect(page).to have_no_css(:h2, text: 'Support and advice')
end

def when_i_click_to_contact_get_into_teaching
click_link_or_button('Find out more about teacher degree apprenticeships.')
end

def then_i_am_redirected_to_the_git_help_and_support_page
expect(page.current_url).to eq(
'https://getintoteaching.education.gov.uk/help-and-support'
'https://getintoteaching.education.gov.uk/train-to-be-a-teacher/teacher-degree-apprenticeships'
)
end
end
2 changes: 2 additions & 0 deletions spec/support/page_objects/find/course_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class CourseShow < PageObjects::Base
element :about_accrediting_provider, '[data-qa=course__about_accrediting_provider]'
element :train_with_disability, '[data-qa=course__train_with_disabilities]'
element :course_advice, '#section-advice'
element :course_tda_advice, '#section-tda-advice'
element :course_support_and_advice, '#section-support-and-advice'
element :course_apply, '#section-apply'
element :apply_link, 'a[data-qa=course__apply_link]'
element :back_link, '[data-qa=page-back]'
Expand Down
Loading