Skip to content

Commit

Permalink
Fix some specs
Browse files Browse the repository at this point in the history
  • Loading branch information
HDinger committed Dec 5, 2024
1 parent 2e78147 commit 9f8cf59
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
7 changes: 4 additions & 3 deletions app/views/repositories/destroy_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ See COPYRIGHT and LICENSE files for more details.
</p>
<p>
<%= link_to project_repository_path(@project),
title: t(:button_delete),
method: :delete,
class: 'button' do %>
title: t(:button_delete),
method: :delete,
data: { "test-selector": "remove-repository-button"},
class: 'button' do %>
<%= op_icon('button--icon icon-remove') %>
<span class="button--text"><%= t(:button_remove) %></span>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ See COPYRIGHT and LICENSE files for more details.
mobile_label: t("ifc_models.label_show_defaults"),
href: defaults_bcf_project_ifc_models_path,
aria: { label: I18n.t("ifc_models.label_show_defaults") },
data: { test_selector: "ifc-show-default-button" },
title: I18n.t("ifc_models.label_show_defaults")) do |button|
button.with_leading_visual_icon(icon: :"eye")
t("ifc_models.label_show_defaults")
Expand All @@ -52,6 +53,7 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(scheme: :primary,
aria: { label: I18n.t("ifc_models.label_new_ifc_model") },
data: { test_selector: "ifc-create-button" },
title: I18n.t("ifc_models.label_new_ifc_model"),
tag: :a,
href: new_bcf_project_ifc_model_path) do |button|
Expand Down
10 changes: 4 additions & 6 deletions modules/bim/spec/support/pages/ifc_models/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def model_listed(listed, model_name)

def add_model_allowed(allowed)
if allowed
click_toolbar_button "IFC model"
click_toolbar_button "ifc-create-button"

expect_correct_page_loaded '.button[type="submit"]'
expect(page).to have_current_path new_bcf_project_ifc_model_path(project)
Expand Down Expand Up @@ -112,7 +112,7 @@ def expect_model_active(model, active = true)
end

def show_defaults(models = [])
click_toolbar_button "Show defaults"
click_toolbar_button "ifc-show-default-button"

expect_correct_page_loaded '[data-test-selector="op-ifc-viewer--container"]'

Expand All @@ -135,10 +135,8 @@ def click_model_link(model_name)
end
end

def click_toolbar_button(name)
within ".toolbar" do
page.find(".button", text: name).click
end
def click_toolbar_button(test_selector)
page.find_test_selector(test_selector).click
end

def click_table_icon(model_name, icon_class)
Expand Down
2 changes: 1 addition & 1 deletion modules/budgets/spec/support/pages/destroy_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def initialize(budget)

def expect_loaded
expect(page)
.to have_content("#{I18n.t(:button_delete)} #{I18n.t(:label_budget_id, id: budget.id)}: #{budget.subject}")
.to have_content("#{I18n.t(:button_delete)} #{budget.subject}")
end

def expect_reassign_option
Expand Down
2 changes: 1 addition & 1 deletion spec/features/repositories/repository_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
find("a.icon-remove", text: I18n.t(:button_remove)).click
expect(page).to have_css(".op-toast.-warning")
SeleniumHubWaiter.wait
find("a", text: I18n.t(:button_remove)).click
page.find_test_selector("remove-repository-button").click
end

vendor = find('select[name="scm_vendor"]')
Expand Down

0 comments on commit 9f8cf59

Please sign in to comment.