Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Oct 20, 2024
1 parent ba0bf92 commit 3ba018d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/committee_members/_modal.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="modal fade" id="add_committee_member_modal" tabindex="-1" aria-hidden="true">
<div class="modal" id="add_committee_member_modal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
Expand Down
2 changes: 1 addition & 1 deletion app/views/committee_members/create.js.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if @committee_member.errors.blank? %>
$("#add_committee_member_modal").modal('hide');
$("#add_committee_member_modal").remove();
$("#committee_members .committee_members_list").append("<%= j render @committee_member %>");
sleep(1)
<% else %>
$("#add_committee_member_modal .modal-body").html('<%= j render("form") %>');
<% end %>
1 change: 0 additions & 1 deletion app/views/committee_members/new.js.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
$("#add_committee_member_modal").remove();
$("body").append('<%= j render("modal") %>');
(new bootstrap.Modal($('#add_committee_member_modal'))).show();
4 changes: 4 additions & 0 deletions test/system/theses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class ThesesTest < ApplicationSystemTestCase
choose('Committee Member')
click_on('Add')

sleep 10

assert_selector 'span', text: 'l1, f1'

click_on('Add committee member')
Expand All @@ -85,6 +87,8 @@ class ThesesTest < ApplicationSystemTestCase
choose('Chair')
click_on('Add')

sleep 10

assert_selector 'span', text: 'l2, f2'

remove1 = 'Remove l1, f1 (Committee Member)'
Expand Down

0 comments on commit 3ba018d

Please sign in to comment.