Skip to content

Commit

Permalink
add additional asserts in samples_test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHuynh333 committed Jan 10, 2025
1 parent a15161f commit 22396c2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/system/projects/samples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ class SamplesTest < ApplicationSystemTestCase
# select all 3 samples
click_button I18n.t(:'projects.samples.index.select_all_button')
click_link I18n.t('projects.samples.index.transfer_button')
assert_selector '#dialog'
within('#dialog') do
within('#list_selections') do
samples.each do |sample|
Expand Down Expand Up @@ -529,7 +530,10 @@ class SamplesTest < ApplicationSystemTestCase
Capybara.execute_script 'sessionStorage.clear()'
# launch transfer dialog
click_link I18n.t('projects.samples.index.transfer_button')

assert_selector '#dialog'
within('#dialog') do
assert_text I18n.t('projects.samples.transfers.dialog.title')
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 @@ -565,6 +569,8 @@ class SamplesTest < ApplicationSystemTestCase
### ACTIONS START ###
click_button I18n.t(:'projects.samples.index.select_all_button')
click_link I18n.t('projects.samples.index.transfer_button')

assert_selector '#dialog'
within('#dialog') do
within('#list_selections') do
samples.each do |sample|
Expand Down Expand Up @@ -657,6 +663,8 @@ class SamplesTest < ApplicationSystemTestCase

# transfer sample
click_link I18n.t('projects.samples.index.transfer_button')

assert_selector '#dialog'
within('#dialog') do
within('#list_selections') do
# additional asserts to help prevent select2 actions below from flaking
Expand Down Expand Up @@ -703,6 +711,7 @@ class SamplesTest < ApplicationSystemTestCase

# launch dialog
click_link I18n.t('projects.samples.index.transfer_button')
assert_selector '#dialog'
within('#dialog') do
# fill destination input
find('input#select2-input').fill_in with: 'invalid project name or puid'
Expand Down Expand Up @@ -1589,6 +1598,7 @@ class SamplesTest < ApplicationSystemTestCase
find("input#sample_#{@sample2.id}").click
end
click_link I18n.t('projects.samples.index.clone_button')
assert_selector '#dialog'
within('#dialog') do
within('#list_selections') do
# additional asserts to help prevent select2 actions below from flaking
Expand Down Expand Up @@ -1639,7 +1649,10 @@ class SamplesTest < ApplicationSystemTestCase
# clear localstorage
Capybara.execute_script 'sessionStorage.clear()'
click_link I18n.t('projects.samples.index.clone_button')

assert_selector '#dialog'
within('#dialog') do
assert_text I18n.t('projects.samples.clones.dialog.title')
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 @@ -1679,6 +1692,7 @@ class SamplesTest < ApplicationSystemTestCase
### ACTIONS START ###
click_button I18n.t(:'projects.samples.index.select_all_button')
click_link I18n.t('projects.samples.index.clone_button')
assert_selector '#dialog'
within('#dialog') do
within('#list_selections') do
samples.each do |sample|
Expand Down Expand Up @@ -1724,6 +1738,7 @@ class SamplesTest < ApplicationSystemTestCase
### ACTIONS START ####
click_button I18n.t(:'projects.samples.index.select_all_button')
click_link I18n.t('projects.samples.index.clone_button')
assert_selector '#dialog'
within('#dialog') do
find('input#select2-input').fill_in with: 'invalid project name or puid'
### ACTIONS END ###
Expand Down Expand Up @@ -1786,6 +1801,8 @@ class SamplesTest < ApplicationSystemTestCase

# clone sample
click_link I18n.t('projects.samples.index.clone_button')

assert_selector '#dialog'
within('#dialog') do
within('#list_selections') do
# additional asserts to help prevent select2 actions below from flaking
Expand Down

0 comments on commit 22396c2

Please sign in to comment.