2023-05-27 22:25:52 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
RSpec.describe 'Profile > Comment templates > User deletes comment template', :js,
|
2023-05-27 22:25:52 +05:30
|
|
|
feature_category: :user_profile do
|
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:saved_reply) { create(:saved_reply, user: user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
it 'shows the user a list of their comment template' do
|
|
|
|
visit profile_comment_templates_path
|
2023-05-27 22:25:52 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
click_button 'Comment template actions'
|
|
|
|
find('[data-testid="comment-template-delete-btn"]').click
|
2023-05-27 22:25:52 +05:30
|
|
|
|
|
|
|
page.within('.gl-modal') do
|
|
|
|
click_button 'Delete'
|
|
|
|
end
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
expect(page).not_to have_content(saved_reply.name)
|
|
|
|
end
|
|
|
|
end
|