summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-08-04 11:02:53 +0200
committerTim Zallmann <tzallmann@gitlab.com>2017-08-07 12:51:35 +0200
commit0e6a8a7830379fd3c40f3ca423589d80fd214213 (patch)
treeea1f5fa020de4606da8a654084ccdabc5b4b49db
parent938fe8aa56cfaccb9a518fce856854c4922d2ced (diff)
downloadgitlab-ce-0e6a8a7830379fd3c40f3ca423589d80fd214213.tar.gz
Fix for squashed avatars, testing if avatar actually loaded
-rw-r--r--app/assets/stylesheets/framework/avatar.scss2
-rw-r--r--spec/features/issues/filtered_search/dropdown_author_spec.rb14
2 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/stylesheets/framework/avatar.scss b/app/assets/stylesheets/framework/avatar.scss
index cb41df8a88d..3809c1af3b6 100644
--- a/app/assets/stylesheets/framework/avatar.scss
+++ b/app/assets/stylesheets/framework/avatar.scss
@@ -34,6 +34,8 @@
width: 40px;
height: 40px;
+ min-width: 40px;
+ min-height: 40px;
padding: 0;
background: $avatar-background;
overflow: hidden;
diff --git a/spec/features/issues/filtered_search/dropdown_author_spec.rb b/spec/features/issues/filtered_search/dropdown_author_spec.rb
index 4bbf18e1dbe..4b730e3a462 100644
--- a/spec/features/issues/filtered_search/dropdown_author_spec.rb
+++ b/spec/features/issues/filtered_search/dropdown_author_spec.rb
@@ -68,6 +68,20 @@ describe 'Dropdown author', js: true do
expect(dropdown_author_size).to eq(4)
end
+ it 'should load the avatar image' do
+ send_keys_to_filtered_search('author:')
+
+ wait_for_requests
+
+ broken_image = execute_script(
+ "return arguments[0].complete && \
+ typeof arguments[0].naturalWidth != \"undefined\" && \
+ arguments[0].naturalWidth > 0",
+ find('#js-dropdown-author li:nth-child(2) img'))
+
+ expect(broken_image).to be_empty
+ end
+
it 'shows current user at top of dropdown' do
send_keys_to_filtered_search('author:')