Commit 7886f44d authored by Mark Lapierre's avatar Mark Lapierre

Allow the Projects Dashboard to be validated

parent 14d19dfa
- form_field_classes = local_assigns[:admin_view] || !Feature.enabled?(:project_list_filter_bar) ? 'input-short js-projects-list-filter' : '' - form_field_classes = local_assigns[:admin_view] || !Feature.enabled?(:project_list_filter_bar) ? 'input-short js-projects-list-filter' : ''
- placeholder = local_assigns[:search_form_placeholder] ? search_form_placeholder : 'Filter by name...' - placeholder = local_assigns[:search_form_placeholder] ? search_form_placeholder : 'Filter by name...'
= form_tag filter_projects_path, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f| = form_tag filter_projects_path, method: :get, class: 'project-filter-form qa-project-filter-form', id: 'project-filter-form' do |f|
= search_field_tag :name, params[:name], = search_field_tag :name, params[:name],
placeholder: placeholder, placeholder: placeholder,
class: "project-filter-form-field form-control #{form_field_classes}", class: "project-filter-form-field form-control #{form_field_classes}",
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
module Dashboard module Dashboard
class Projects < Page::Base class Projects < Page::Base
view 'app/views/shared/projects/_search_form.html.haml' do view 'app/views/shared/projects/_search_form.html.haml' do
element :form_filter_by_name, /form_tag.+id: 'project-filter-form'/ # rubocop:disable QA/ElementWithPattern element :project_filter_form, required: true
end end
def go_to_project(name) def go_to_project(name)
...@@ -14,10 +14,14 @@ module QA ...@@ -14,10 +14,14 @@ module QA
find_link(text: name).click find_link(text: name).click
end end
def self.path
'/'
end
private private
def filter_by_name(name) def filter_by_name(name)
page.within('form#project-filter-form') do within_element(:project_filter_form) do
fill_in :name, with: name fill_in :name, with: name
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment