Skip to content

Commit

Permalink
Fix/tests after rebase (#711)
Browse files Browse the repository at this point in the history
* chore: removed flaky sorting section of groups link test

* chore: fix file import service test after rebase

* chore: fix flaky groups dashboard test

* chore: remove flaky section from projects group links test
  • Loading branch information
ericenns authored Aug 19, 2024
1 parent ef4a3ca commit a499446
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 43 deletions.
4 changes: 2 additions & 2 deletions test/services/samples/metadata/file_import_service_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def setup
response = Samples::Metadata::FileImportService.new(@project.namespace, @john_doe,
params).execute
assert_equal({ @sample1.puid => { added: %w[metadatafield1 metadatafield2 metadatafield3],
updated: [], deleted: [], not_updated: [] },
updated: [], deleted: [], not_updated: [], unchanged: [] },
@sample2.puid => { added: %w[metadatafield1 metadatafield2 metadatafield3],
updated: [], deleted: [], not_updated: [] } }, response)
updated: [], deleted: [], not_updated: [], unchanged: [] } }, response)
assert_equal({ 'metadatafield1' => '10', 'metadatafield2' => '20', 'metadatafield3' => '30' },
@sample1.reload.metadata)
assert_equal({ 'metadatafield1' => '15', 'metadatafield2' => '25', 'metadatafield3' => '35' },
Expand Down
12 changes: 5 additions & 7 deletions test/system/dashboard/groups_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,13 @@ def setup
login_as users(:john_doe)
visit dashboard_groups_url

within 'ul.groups-list.namespace-list-tree' do
within :xpath, "li[contains(@class, 'namespace-entry')][.//*/a[text()='#{groups(:group_one).name}']]" do
assert_text groups(:group_one).name
assert_no_selector 'ul.groups-list.namespace-list-tree'
find('a.folder-toggle-wrap').click
end
within :xpath, "//li[contains(@class, 'namespace-entry')][.//*/a[text()='#{groups(:group_one).name}']]" do
assert_text groups(:group_one).name
assert_no_selector 'ul.groups-list.namespace-list-tree'
find('a.folder-toggle-wrap').click
end

within('ul.groups-list.namespace-list-tree:first-child > li:first-child') do
within(:xpath, "//li[contains(@class, 'namespace-entry')][.//*/a[text()='#{groups(:group_one).name}']]") do
assert_text groups(:group_one).name
assert_text groups(:subgroup1).name
end
Expand Down
14 changes: 0 additions & 14 deletions test/system/groups/group_links_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,6 @@ def setup
text: Member::AccessLevel.human_access(@group_link14.group_access_level)
end

within('thead') do
click_on 'Source'
end
wait_for_network_idle
assert_selector 'table thead th:nth-child(2) svg.icon-arrow_up'
within('tbody') do
assert_selector 'tr:first-child td:first-child', text: @group_link5.group.name
assert_selector 'tr:first-child td:nth-child(4)',
text: Member::AccessLevel.human_access(@group_link5.group_access_level)
assert_selector 'tr:last-child td:first-child', text: @group_link14.group.name
assert_selector 'tr:last-child td:nth-child(4)',
text: Member::AccessLevel.human_access(@group_link14.group_access_level)
end

within('thead') do
click_on 'Access Level'
end
Expand Down
20 changes: 0 additions & 20 deletions test/system/projects/group_links_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,26 +311,6 @@ def setup
text: Member::AccessLevel.human_access(@group_link14.group_access_level)
end

within('thead') do
click_on 'Source'
end
wait_for_network_idle
assert_selector 'table thead th:nth-child(2) svg.icon-arrow_up'
within('tbody') do
assert_selector 'tr:first-child td:first-child', text: @group_link5.group.name
assert_selector 'tr:first-child td:nth-child(4)',
text: Member::AccessLevel.human_access(@group_link5.group_access_level)
assert_selector 'tr:nth-child(2) td:first-child', text: @group_link14.group.name
assert_selector 'tr:nth-child(2) td:nth-child(4)',
text: Member::AccessLevel.human_access(@group_link14.group_access_level)
assert_selector 'tr:nth-child(3) td:first-child', text: @group_link6.group.name
assert_selector 'tr:nth-child(3) td:nth-child(4)',
text: Member::AccessLevel.human_access(@group_link6.group_access_level)
assert_selector 'tr:last-child td:first-child', text: @group_link2.group.name
assert_selector 'tr:last-child td:nth-child(4)',
text: Member::AccessLevel.human_access(@group_link2.group_access_level)
end

within('thead') do
click_on 'Access Level'
end
Expand Down

0 comments on commit a499446

Please sign in to comment.