Skip to content

Commit

Permalink
make sure federated categories are working on browse page
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Jan 30, 2025
1 parent e42ab74 commit d0e2b98
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/system/federation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class FederationTest < ApplicationSystemTestCase


test "perform federated browse and make sure federation is working" do
###### Federation non activated
visit "#{@ontologies_path}"
loop do
loading_element = find_all(".browse-sket").any?
Expand All @@ -37,6 +38,17 @@ class FederationTest < ApplicationSystemTestCase
end
results_count_no_federation = first('.browse-desc-text').text.scan(/\d+/).first.to_i

find("[data-target='#browse-categories-filter']").click
loop do
loading_element = find_all(".browse-sket").any?
break unless loading_element
end

number_categories_no_federation = all("input", visible: :all).count


### Federation activated

visit "#{@ontologies_path}?sort_by=ontology_name&portals=agroportal"

# Scroll all down to display all the results
Expand All @@ -57,5 +69,18 @@ class FederationTest < ApplicationSystemTestCase
ontologies_titles = all(".browse-ontology-title").map { |a| a.text.strip }

assert_equal ontologies_titles.count, ontologies_titles.uniq.count, "There are duplicated results !"


find("[data-target='#browse-categories-filter']").click

loop do
loading_element = find_all(".browse-sket").any?
break unless loading_element
end

number_categories_federation = all("input", visible: :all).count

assert_not_equal number_categories_no_federation, number_categories_federation

end
end

0 comments on commit d0e2b98

Please sign in to comment.