Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHuynh333 committed Dec 20, 2024
1 parent 0e197ca commit 16b4535
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/system/projects/samples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class SamplesTest < ApplicationSystemTestCase
### ACTIONS END ###

### results start ###
Sample.search_index.refresh
# flash msg
assert_text I18n.t('projects.samples.create.success')
# verify redirect to sample show page after successful sample creation
Expand Down Expand Up @@ -497,6 +498,7 @@ class SamplesTest < ApplicationSystemTestCase
### ACTIONS END ###

### VERIFY START ###
Sample.search_index.refresh
within('#dialog') do
# error messages in dialog
assert_text I18n.t('projects.samples.transfers.create.error')
Expand All @@ -512,7 +514,6 @@ class SamplesTest < ApplicationSystemTestCase
assert_selector "tr[id='#{@sample30.id}']"

# destination project
Sample.search_index.refresh
visit namespace_project_samples_url(namespace, project25)
assert_text strip_tags(I18n.t(:'viral.pagy.limit_component.summary', from: 1, to: 4, count: 4,
locale: @user.locale))
Expand Down Expand Up @@ -570,6 +571,10 @@ class SamplesTest < ApplicationSystemTestCase
# transfer sample
click_link I18n.t('projects.samples.index.transfer_button')
within('#dialog') do
within('#list_selections') do
assert_text @sample1.name
assert_text @sample1.puid
end
find('input#select2-input').click
find("button[data-viral--select2-value-param='#{@project2.id}']").click
click_on I18n.t('projects.samples.transfers.dialog.submit_button')
Expand Down Expand Up @@ -1455,6 +1460,12 @@ class SamplesTest < ApplicationSystemTestCase
end
click_link I18n.t('projects.samples.index.clone_button')
within('#dialog') do
within('#list_selections') do
assert_text @sample1.name
assert_text @sample1.puid
assert_text @sample2.name
assert_text @sample2.puid
end
find('input#select2-input').click
find("button[data-viral--select2-value-param='#{@project2.id}']").click
click_on I18n.t('projects.samples.clones.dialog.submit_button')
Expand Down Expand Up @@ -1544,8 +1555,9 @@ class SamplesTest < ApplicationSystemTestCase
sample_name: @sample30.name).gsub(':', '')
click_on I18n.t('projects.samples.shared.errors.ok_button')
end
visit namespace_project_samples_url(namespace, project25)

Sample.search_index.refresh
visit namespace_project_samples_url(namespace, project25)
# samples 1 and 2 still successfully clone
within('#samples-table table tbody') do
assert_text @sample1.name
Expand Down Expand Up @@ -1616,6 +1628,10 @@ class SamplesTest < ApplicationSystemTestCase
# clone sample
click_link I18n.t('projects.samples.index.clone_button')
within('#dialog') do
within('#list_selections') do
assert_text @sample1.name
assert_text @sample1.puid
end
find('input#select2-input').click
find("button[data-viral--select2-value-param='#{@project2.id}']").click
click_on I18n.t('projects.samples.clones.dialog.submit_button')
Expand Down

0 comments on commit 16b4535

Please sign in to comment.