Skip to content
代码片段 群组 项目
未验证 提交 771c70ae 编辑于 作者: Peter Leitzen's avatar Peter Leitzen
浏览文件

Fix flaky feature specs for "user awards emoji"

Use `wait_for_requests` where needed.
上级 5ad85764
No related branches found
No related tags found
无相关合并请求
...@@ -11,27 +11,35 @@ ...@@ -11,27 +11,35 @@
describe 'logged in' do describe 'logged in' do
before do before do
sign_in(user) sign_in(user)
visit project_merge_request_path(project, merge_request)
visit project_merge_request_path(project, merge_request)
wait_for_requests wait_for_requests
end end
it 'adds award to merge request' do it 'adds award to merge request' do
first('[data-testid="award-button"]').click first('[data-testid="award-button"]').click
wait_for_requests
expect(page).to have_selector('[data-testid="award-button"].selected') expect(page).to have_selector('[data-testid="award-button"].selected')
expect(first('[data-testid="award-button"]')).to have_content '1' expect(first('[data-testid="award-button"]')).to have_content '1'
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
wait_for_requests
expect(first('[data-testid="award-button"]')).to have_content '1' expect(first('[data-testid="award-button"]')).to have_content '1'
end end
it 'removes award from merge request' do it 'removes award from merge request' do
first('[data-testid="award-button"]').click first('[data-testid="award-button"]').click
wait_for_requests
expect(first('[data-testid="award-button"]')).to have_content '1' expect(first('[data-testid="award-button"]')).to have_content '1'
find('[data-testid="award-button"].selected').click find('[data-testid="award-button"].selected').click
wait_for_requests
expect(first('[data-testid="award-button"]')).to have_content '0' expect(first('[data-testid="award-button"]')).to have_content '0'
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
wait_for_requests
expect(first('[data-testid="award-button"]')).to have_content '0' expect(first('[data-testid="award-button"]')).to have_content '0'
end end
...@@ -62,6 +70,7 @@ ...@@ -62,6 +70,7 @@
describe 'logged out' do describe 'logged out' do
before do before do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
wait_for_requests
end end
it 'does not see award menu button' do it 'does not see award menu button' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册