Commit 031c5584 authored by Imre Farkas's avatar Imre Farkas

Merge branch '270459-fix-flaky-snippet-spec' into 'master'

Fix tests relying on lazy-loaded images

See merge request gitlab-org/gitlab!47600
parents 8d039edc 57e01dbc
......@@ -114,7 +114,7 @@ RSpec.describe 'Update Epic', :js do
end
it 'uploads a file when dragging into textarea' do
link_css = 'a.no-attachment-icon img[alt="banana_sample"]'
link_css = 'a.no-attachment-icon img.js-lazy-loaded[alt="banana_sample"]'
link_match = %r{/groups/#{Regexp.escape(group.full_path)}/-/uploads/\h{32}/banana_sample\.gif\z}
dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif')
......
......@@ -62,7 +62,7 @@ RSpec.describe 'Projects > Snippets > Create Snippet', :js do
click_button('Create snippet')
wait_for_requests
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
link = find('a.no-attachment-icon img.js-lazy-loaded[alt="banana_sample"]')['src']
expect(link).to match(%r{/#{Regexp.escape(project.full_path)}/uploads/\h{32}/banana_sample\.gif\z})
end
......
......@@ -78,7 +78,7 @@ RSpec.describe 'User uploads file to note' do
click_button 'Comment'
wait_for_requests
expect(find('a.no-attachment-icon img[alt="dk"]')['src'])
expect(find('a.no-attachment-icon img.js-lazy-loaded[alt="dk"]')['src'])
.to match(%r{/#{project.full_path}/uploads/\h{32}/dk\.png$})
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