From 63485cd861ce0c66e3bac79f5b048e8845ee3499 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 10 Feb 2016 14:54:07 +0100 Subject: [PATCH] Added browser tests for searchable_select and column_select. Streamline of test files. --- .../app/lib/app_post/column_select.coffee | 2 +- .../app/views/generic/column_select.jst.eco | 6 +- app/views/tests/form_column_select.html.erb | 22 +++++++ app/views/tests/form_extended.html.erb | 2 +- .../tests/form_searchable_select.html.erb | 22 +++++++ app/views/tests/form_trim.html.erb | 2 +- app/views/tests/form_validation.html.erb | 2 +- app/views/tests/html_utils.html.erb | 2 +- app/views/tests/model_ui.html.erb | 2 +- config/routes/test.rb | 26 ++++---- public/assets/tests/form_column_select.js | 53 ++++++++++++++++ .../{form-extended.js => form_extended.js} | 0 public/assets/tests/form_searchable_select.js | 62 +++++++++++++++++++ .../tests/{form-trim.js => form_trim.js} | 0 ...{form-validation.js => form_validation.js} | 0 .../tests/{html-utils.js => html_utils.js} | 0 .../assets/tests/{model-ui.js => model_ui.js} | 0 test/browser/aab_unit_test.rb | 38 ++++++++---- 18 files changed, 208 insertions(+), 33 deletions(-) create mode 100644 app/views/tests/form_column_select.html.erb create mode 100644 app/views/tests/form_searchable_select.html.erb create mode 100644 public/assets/tests/form_column_select.js rename public/assets/tests/{form-extended.js => form_extended.js} (100%) create mode 100644 public/assets/tests/form_searchable_select.js rename public/assets/tests/{form-trim.js => form_trim.js} (100%) rename public/assets/tests/{form-validation.js => form_validation.js} (100%) rename public/assets/tests/{html-utils.js => html_utils.js} (100%) rename public/assets/tests/{model-ui.js => model_ui.js} (100%) diff --git a/app/assets/javascripts/app/lib/app_post/column_select.coffee b/app/assets/javascripts/app/lib/app_post/column_select.coffee index 8ce6a520c..135f317ec 100644 --- a/app/assets/javascripts/app/lib/app_post/column_select.coffee +++ b/app/assets/javascripts/app/lib/app_post/column_select.coffee @@ -88,7 +88,7 @@ class App.ColumnSelect extends Spine.Controller onFilterKeydown: (event) -> return if event.keyCode != 13 - + firstVisibleOption = @poolOptions.not('.is-filtered').not('.is-hidden').first() if firstVisibleOption @select firstVisibleOption.attr('data-value') \ No newline at end of file diff --git a/app/assets/javascripts/app/views/generic/column_select.jst.eco b/app/assets/javascripts/app/views/generic/column_select.jst.eco index b60d40b1b..8c1031be9 100644 --- a/app/assets/javascripts/app/views/generic/column_select.jst.eco +++ b/app/assets/javascripts/app/views/generic/column_select.jst.eco @@ -8,16 +8,16 @@ multiple > <% for option in @attribute.options: %> - + <% end %> -
+
<%- @T('Nothing selected') %>
<% for option in @attribute.options: %>
<%= option.name %>
<% end %>
-
+
<% if @attribute.options.length > 10: %>