Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Oct 23, 2024
2 parents 248d67d + 08d4a3a commit 9abf711
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app/views/documents/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Upload Supplementary Thesis Files
<% end %>
<% if @document.usage == 'licence' %>
Upload Licence Agreements
Upload Licence File
<% end %>
<% if @document.usage == 'embargo' %>
Upload Embargo Documents
Expand Down
2 changes: 1 addition & 1 deletion app/views/student_view/process/begin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<%= simple_form_for @student, method: :post, url: organize_student_information_student_thesis_path(@student, @thesis), html: { class: "form-horizontal border border-2 bg-light" } do |f| %>

<%= f.label :email_external, label: "Non-YorkU Email Address", required: true, class: "d-block mb-1" %>
<p class="form-text">raw(<%= AppSettings.student_begin_external_non_yorku_email %>)</p>
<div class="form-text"><%= raw(AppSettings.student_begin_external_non_yorku_email) %></div>
<%= f.input :email_external, label: false %>

<div class="row">
Expand Down
8 changes: 4 additions & 4 deletions app/views/student_view/process/review.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<h4 title="LAC Supplementary Licence File Upload">Library and Archives Canada Licence</h4>

<% if AppSettings.student_review_lac_licence_instructions.present? %>
<div class="small text-secondary">
<div class="form-text">
<%= raw(AppSettings.student_review_lac_licence_instructions) %>
</div>
<% end %>
Expand All @@ -55,7 +55,7 @@
<% unless block_thesis_changes?(@thesis) %>
<p>
<%= link_to new_student_thesis_document_path(@student, @thesis, usage: 'licence', supplemental: true), class: "btn btn-primary", remote: true do %>
Upload Licence Files
Upload Licence File
<% end %>
</p>
<% end %>
Expand All @@ -67,7 +67,7 @@

<div class="licence-box my-5 bg-light p-3" >
<h4 title="Yorkspace Distribution Licence">Yorkspace Distribution Licence</h4>
<p class="small text-secondary">Please review the licence below and accept if you agree</p>
<div class="form-text">Please review the licence below and accept if you agree</div>
<hr class="text-primary border-3">
<p>
<a id="ydlButton" class="btn btn-primary" data-bs-toggle="collapse" href="#collapseYDL" role="button" aria-expanded="false" aria-controls="collapseYDL">
Expand All @@ -89,7 +89,7 @@

<div class="licence-box my-5 bg-light p-3" >
<h4 title="ETD Licence Agreement">ETD Licence Agreement</h4>
<p class="small text-secondary">Please review the licence below and accept if you agree</p>
<div class="form-text">Please review the licence below and accept if you agree</div>
<hr class="text-primary border-3">
<p>
<a id="etdButton" class="btn btn-primary" data-bs-toggle="collapse" href="#collapseETD" role="button" aria-expanded="false" aria-controls="collapseETD">
Expand Down
2 changes: 1 addition & 1 deletion app/views/student_view/process/upload.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<% unless block_thesis_changes?(@thesis) %>
<% if @primary_documents.count == 0 %>
<%= link_to new_student_thesis_document_path(@student, @thesis, usage: 'thesis', supplemental: false), class: "btn btn-primary", remote: true do %>
Upload Primary Thesis Files
Upload Primary Thesis File
<% end %>
<% end %>
<% end %>
Expand Down
7 changes: 4 additions & 3 deletions app/views/theses/_form_student_editable.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<%= f.input :language, collection: Thesis::LANGUAGE, readonly: read_only_if_student("language"), input_html: { aria_label: "Language" } %>

<%= f.label :abstract, label: "Abstract", required: true, class: "d-block mb-1" %>
<small class="form-text"><%= raw(AppSettings.student_update_details_abstract) %></small>

<div class="form-text"><%= raw(AppSettings.student_update_details_abstract) %></div>
<%= f.input :abstract, input_html: { class: "", rows: "8" }, label: false, readonly: read_only_if_student("abstract") %>

<%= f.label :loc_subject_ids, label: "Subjects", class: "d-block mb-1" %>
<small class="form-text"><%= raw(AppSettings.student_update_details_subjects) %></small>
<div class="form-text"><%= raw(AppSettings.student_update_details_subjects) %></div>

<div id="thesis_loc_subject_ids" class="span3 no-space">
<% @thesis.loc_subjects.each_with_index do |subject, index| %>
Expand All @@ -22,5 +23,5 @@
</div>

<%= f.label :keywords, label: "Keywords", class: "d-block mb-1" %>
<small class="form-text"><%= raw(AppSettings.student_update_details_keywords) %></small>
<div class="form-text"><%= raw(AppSettings.student_update_details_keywords) %></div>
<%= f.input :keywords, label: false, input_html: { rows: "2", aria:{ label: "Keywords" } }, readonly: read_only_if_student("keywords") %>
110 changes: 88 additions & 22 deletions db/seeds.rb

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions test/system/app_settings_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ class AppSettingsTest < ApplicationSystemTestCase
click_link("Login as this student")
fill_in 'student_email_external', with: '[email protected]'
click_button('Continue')
#assert_selector "small", text: 'Initial Text Test'
assert_selector "small", text: 'Abstract Text Test'
assert_selector "small", text: 'Subjects Text Test'
assert_selector "small", text: 'Keywords Text Test'
assert_selector "div", text: 'Abstract Text Test'
assert_selector "div", text: 'Subjects Text Test'
assert_selector "div", text: 'Keywords Text Test'
end

test 'Student submission Upload files message' do
Expand Down Expand Up @@ -198,7 +197,7 @@ class AppSettingsTest < ApplicationSystemTestCase
attach_file('document_file', Rails.root.join('test/fixtures/files/pdf-document.pdf'))
click_button('Upload')
click_link('Continue')
click_link_or_button('Upload Licence Files')
click_link_or_button('Upload Licence File')
attach_file('document_file', Rails.root.join('test/fixtures/files/pdf-document.pdf'))
click_button('Upload')
check 'thesis_lac_licence_agreement'
Expand Down
2 changes: 1 addition & 1 deletion test/system/students_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class StudentsTest < ApplicationSystemTestCase
click_button("Accept and Continue")
assert_selector(".alert-warning", text: "Please upload signed LAC licence documents.")

click_link_or_button('Upload Licence Files')
click_link_or_button('Upload Licence File')
attach_file("document_file", Rails.root.join('test/fixtures/files/Tony_Rich_E_2012_Phd.pdf'))
click_button('Upload')

Expand Down
2 changes: 1 addition & 1 deletion test/system/theses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class ThesesTest < ApplicationSystemTestCase
click_link(@thesis_01.title)

click_on("Upload Licence Agreements")
assert_selector "h2", text: "Upload Licence Agreements", visible: :all
assert_selector "h2", text: "Upload Licence File", visible: :all
attach_file("document_file", Rails.root.join('test/fixtures/files/Tony_Rich_E_2012_Phd.pdf'))
click_button('Upload')
assert_not_empty find('.licence-file').text, "The .licence-file element is empty, no file"
Expand Down

0 comments on commit 9abf711

Please sign in to comment.