summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-12 22:57:50 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-15 16:34:04 +0100
commit7e7f266139ca9f4721f18e85e99e9796fd87eca3 (patch)
tree7155903852ebbe65d1bbd019cdaef2c3c93537a0
parente2ffb8698751769879e21626c79f9c607a630bf5 (diff)
downloadgitlab-ce-disable-css-and-jquery-animations-for-capybara.tar.gz
Add test.js and test.css to disable animations during testing and include these in _head when testingdisable-css-and-jquery-animations-for-capybara
-rw-r--r--app/assets/javascripts/test.js1
-rw-r--r--app/assets/stylesheets/test.scss17
-rw-r--r--app/views/layouts/_head.html.haml2
-rw-r--r--config/application.rb1
-rw-r--r--config/webpack.config.js1
5 files changed, 22 insertions, 0 deletions
diff --git a/app/assets/javascripts/test.js b/app/assets/javascripts/test.js
new file mode 100644
index 00000000000..c4c7918a68f
--- /dev/null
+++ b/app/assets/javascripts/test.js
@@ -0,0 +1 @@
+$.fx.off = true;
diff --git a/app/assets/stylesheets/test.scss b/app/assets/stylesheets/test.scss
new file mode 100644
index 00000000000..7d9f3da79c5
--- /dev/null
+++ b/app/assets/stylesheets/test.scss
@@ -0,0 +1,17 @@
+* {
+ -o-transition: none !important;
+ -moz-transition: none !important;
+ -ms-transition: none !important;
+ -webkit-transition: none !important;
+ transition: none !important;
+ -o-transform: none !important;
+ -moz-transform: none !important;
+ -ms-transform: none !important;
+ -webkit-transform: none !important;
+ transform: none !important;
+ -webkit-animation: none !important;
+ -moz-animation: none !important;
+ -o-animation: none !important;
+ -ms-animation: none !important;
+ animation: none !important;
+}
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index afcc2b6e4f3..9e354987401 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -27,6 +27,7 @@
= stylesheet_link_tag "application", media: "all"
= stylesheet_link_tag "print", media: "print"
+ = stylesheet_link_tag "test", media: "all" if Rails.env.test?
= Gon::Base.render_data
@@ -34,6 +35,7 @@
= webpack_bundle_tag "common"
= webpack_bundle_tag "main"
= webpack_bundle_tag "raven" if current_application_settings.clientside_sentry_enabled
+ = webpack_bundle_tag "test" if Rails.env.test?
- if content_for?(:page_specific_javascripts)
= yield :page_specific_javascripts
diff --git a/config/application.rb b/config/application.rb
index bf3fb7a18c1..95ba6774916 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -106,6 +106,7 @@ module Gitlab
config.assets.precompile << "xterm/xterm.css"
config.assets.precompile << "lib/ace.js"
config.assets.precompile << "vendor/assets/fonts/*"
+ config.assets.precompile << "test.css"
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 5d5a42512b1..37ec1611adf 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -63,6 +63,7 @@ var config = {
users: './users/users_bundle.js',
raven: './raven/index.js',
vue_merge_request_widget: './vue_merge_request_widget/index.js',
+ test: './test.js',
},
output: {