2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-07-16 13:00:49 +00:00
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Chat Handling', type: :system do
|
|
|
|
let(:agent_chat_switch_selector) { '#navigation .js-chatMenuItem .js-switch' }
|
2021-09-01 07:22:36 +00:00
|
|
|
let(:chat_url) { "/assets/chat/#{chat_url_type}.html?port=#{ENV['WS_PORT']}" }
|
|
|
|
let(:chat_url_type) { 'znuny' }
|
2021-07-16 13:00:49 +00:00
|
|
|
|
|
|
|
def authenticate
|
|
|
|
Setting.set('chat', true)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
2021-09-01 07:22:36 +00:00
|
|
|
def check_content(selector, value, should_match: true, wait: nil)
|
|
|
|
if should_match
|
|
|
|
expect(page).to have_css(selector, wait: wait, text: value)
|
|
|
|
else
|
|
|
|
expect(page).to have_no_css(selector, wait: wait, text: value)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def enable_agent_chat
|
|
|
|
click agent_chat_switch_selector
|
|
|
|
click 'a[href="#customer_chat"]'
|
|
|
|
end
|
|
|
|
|
|
|
|
def open_chat_dialog
|
|
|
|
expect(page).to have_css('.zammad-chat')
|
|
|
|
click '.zammad-chat .js-chat-open'
|
|
|
|
expect(page).to have_css('.zammad-chat-is-shown')
|
|
|
|
end
|
|
|
|
|
|
|
|
def send_customer_message(message)
|
|
|
|
find('.zammad-chat .zammad-chat-input').send_keys(message)
|
|
|
|
click '.zammad-chat .zammad-chat-send'
|
|
|
|
end
|
|
|
|
|
|
|
|
def send_agent_message(message)
|
2022-03-04 13:49:17 +00:00
|
|
|
input = find('.active .chat-window .js-customerChatInput')
|
|
|
|
input.send_keys(message)
|
|
|
|
# Work around an obsure bug of send_keys sometimes not working on Firefox headless.
|
|
|
|
if input.text != message
|
|
|
|
input.execute_script("this.textContent = '#{message}'")
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
click '.active .chat-window .js-send'
|
|
|
|
end
|
|
|
|
|
2021-08-13 22:05:18 +00:00
|
|
|
shared_examples 'chat button is hidden after idle timeout' do
|
2021-09-01 07:22:36 +00:00
|
|
|
it 'check that button is hidden after idle timeout', authenticated_as: :authenticate do
|
2021-08-13 22:05:18 +00:00
|
|
|
click agent_chat_switch_selector
|
2021-07-16 13:00:49 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
visit chat_url
|
2021-07-16 13:00:49 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_css('.zammad-chat', visible: :all)
|
|
|
|
expect(page).to have_css('.zammad-chat-is-hidden', visible: :all)
|
|
|
|
expect(page).to have_no_css('.open-zammad-chat:not([style*="display: none"]', visible: :all)
|
|
|
|
end
|
2021-08-13 22:05:18 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-09-01 07:22:36 +00:00
|
|
|
shared_examples 'chat messages' do
|
|
|
|
it 'messages in each direction, starting on agent side', authenticated_as: :authenticate do
|
|
|
|
enable_agent_chat
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
visit chat_url
|
|
|
|
open_chat_dialog
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .js-acceptChat'
|
|
|
|
|
|
|
|
expect(page).to have_no_css('.active .chat-window .chat-status.is-modified')
|
|
|
|
check_content('.active .chat-window .js-body', chat_url)
|
|
|
|
|
|
|
|
send_agent_message('my name is me')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
check_content('.zammad-chat .zammad-chat-agent-status', 'Online')
|
|
|
|
check_content('.zammad-chat', 'my name is me')
|
|
|
|
send_customer_message('my name is customer')
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
check_content('.active .chat-window', 'my name is customer')
|
|
|
|
expect(page).to have_css('.active .chat-window .chat-status.is-modified')
|
|
|
|
|
|
|
|
click '.active .chat-window .js-customerChatInput'
|
|
|
|
|
|
|
|
expect(page).to have_no_css('.active .chat-window .chat-status.is-modified')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
click '.js-chat-toggle .zammad-chat-header-icon'
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
check_content('.active .chat-window', 'closed the conversation')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'messages in each direction, starting on customer side', authenticated_as: :authenticate do
|
|
|
|
enable_agent_chat
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
visit chat_url
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
open_chat_dialog
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .js-acceptChat'
|
|
|
|
|
|
|
|
expect(page).to have_no_css('.active .chat-window .chat-status.is-modified')
|
|
|
|
|
|
|
|
# Keep focus outside of chat window to check .chat-status.is-modified later.
|
|
|
|
click '#global-search'
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
check_content('.zammad-chat .zammad-chat-agent-status', 'Online')
|
|
|
|
send_customer_message('my name is customer')
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
expect(page).to have_css('.active .chat-window .chat-status.is-modified')
|
|
|
|
check_content('.active .chat-window', 'my name is customer')
|
|
|
|
|
|
|
|
send_agent_message('my name is me')
|
|
|
|
expect(page).to have_no_css('.active .chat-window .chat-status.is-modified')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
check_content('.zammad-chat', 'my name is me')
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .chat-window .js-disconnect:not(.is-hidden)'
|
|
|
|
click '.active .chat-window .js-close'
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.zammad-chat .zammad-chat-agent-status', 'Offline')
|
|
|
|
check_content('.zammad-chat', %r{(Chat closed by|Chat beendet von)})
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
click '.zammad-chat .js-chat-toggle .zammad-chat-header-icon'
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_no_css('.zammad-chat-is-open')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
open_chat_dialog
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .js-acceptChat'
|
|
|
|
|
|
|
|
expect(page).to have_css('.active .chat-window .chat-status')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
shared_examples 'open chat with button' do
|
|
|
|
it 'open the chat', authenticated_as: :authenticate do
|
|
|
|
enable_agent_chat
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
visit chat_url
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_css('.zammad-chat', visible: :all)
|
|
|
|
expect(page).to have_css('.zammad-chat-is-hidden', visible: :all)
|
|
|
|
expect(page).to have_no_css('.zammad-chat-is-shown', visible: :all)
|
|
|
|
expect(page).to have_no_css('.zammad-chat-is-open', visible: :all)
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
click '.open-zammad-chat'
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_css('.zammad-chat-is-shown', visible: :all)
|
|
|
|
expect(page).to have_css('.zammad-chat-is-open', visible: :all)
|
|
|
|
check_content('.zammad-chat-modal-text', %r{(waiting|Warte)})
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
click '.zammad-chat-header-icon-close'
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_no_css('.zammad-chat-is-shown', visible: :all)
|
|
|
|
expect(page).to have_no_css('.zammad-chat-is-open', visible: :all)
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
shared_examples 'timeouts' do
|
|
|
|
it 'check different timeouts', authenticated_as: :authenticate do
|
|
|
|
enable_agent_chat
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
visit chat_url
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
# No customer action, hide the widget.
|
|
|
|
expect(page).to have_css('.zammad-chat')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_no_css('.zammad-chat')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
refresh
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
# No agent action, show sorry screen.
|
|
|
|
open_chat_dialog
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.zammad-chat-modal-text', %r{(waiting|Warte)})
|
|
|
|
check_content('.zammad-chat-modal-text', %r{(takes longer|dauert länger)})
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
refresh
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
# No customer action, show sorry screen.
|
|
|
|
open_chat_dialog
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .js-acceptChat'
|
|
|
|
|
|
|
|
send_agent_message('agent is asking')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.zammad-chat', 'agent is asking')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.zammad-chat-modal-text', %r{(Since you didn't respond|Da Sie in den letzten)}, wait: 30)
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
# Test the restart of inactive chat.
|
|
|
|
click '.active .chat-window .js-close'
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
click '.js-restart'
|
|
|
|
open_chat_dialog
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .js-acceptChat'
|
|
|
|
|
|
|
|
send_agent_message('my name is me')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
check_content('.zammad-chat', 'my name is me')
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when chat is activated or disabled' do
|
|
|
|
it 'switch the chat setting', authenticated_as: :authenticate do
|
|
|
|
visit '/#channels/chat'
|
|
|
|
|
|
|
|
click '.content.active .js-chatSetting'
|
|
|
|
|
|
|
|
expect(page).to have_no_css(agent_chat_switch_selector)
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
visit chat_url
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.settings', '{"state":"chat_disabled"}')
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.content.active .js-chatSetting'
|
|
|
|
|
|
|
|
expect(page).to have_css(agent_chat_switch_selector)
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
refresh
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_no_css('.zammad-chat')
|
|
|
|
check_content('.settings', '{"state":"chat_disabled"}', should_match: false)
|
|
|
|
check_content('.settings', '{"event":"chat_status_customer","data":{"state":"offline"}}')
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click agent_chat_switch_selector
|
|
|
|
click 'a[href="#customer_chat"]'
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
refresh
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_css('.zammad-chat')
|
|
|
|
check_content('.settings', '{"event":"chat_status_customer","data":{"state":"offline"}}', should_match: false)
|
|
|
|
check_content('.settings', '{"state":"online"}')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
click '.zammad-chat .js-chat-open'
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_css('.zammad-chat-is-shown')
|
|
|
|
check_content('.zammad-chat-modal-text', %r{(waiting|Warte)})
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
check_content('.js-chatMenuItem .counter', '1')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
click '.zammad-chat .js-chat-toggle .zammad-chat-header-icon'
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.zammad-chat-modal-text', %r{(waiting|Warte)}, should_match: false)
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
expect(page).to have_no_css('.js-chatMenuItem .counter')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when changing chat preferences for current agent' do
|
|
|
|
it 'use chat phrase preference', authenticated_as: :authenticate do
|
|
|
|
enable_agent_chat
|
|
|
|
|
|
|
|
click '.active .js-settings'
|
|
|
|
|
|
|
|
modal_ready
|
|
|
|
|
|
|
|
find('.modal [name="chat::phrase::1"]').send_keys('Hi Stranger!;My Greeting')
|
|
|
|
click '.modal .js-submit'
|
|
|
|
|
|
|
|
modal_disappear
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
visit chat_url
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
open_chat_dialog
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
click '.active .js-acceptChat'
|
|
|
|
|
|
|
|
expect(page).to have_css('.active .chat-window .chat-status')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
check_content('.zammad-chat', %r{(Hi Stranger|My Greeting)})
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
send_agent_message('my name is me')
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
check_content('.zammad-chat', 'my name is me')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
refresh
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
expect(page).to have_css('.zammad-chat')
|
|
|
|
check_content('.zammad-chat', %r{(Hi Stranger|My Greeting)})
|
|
|
|
check_content('.zammad-chat', 'my name is me')
|
2021-09-01 07:22:36 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
visit "#{chat_url}#new_hash"
|
|
|
|
end
|
2021-09-01 07:22:36 +00:00
|
|
|
|
|
|
|
check_content('.active .chat-window .js-body', "#{chat_url}#new_hash")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-08-13 22:05:18 +00:00
|
|
|
context 'when jquery variant is used' do
|
2021-09-01 07:22:36 +00:00
|
|
|
context 'when normal mode is used' do
|
|
|
|
include_examples 'chat messages'
|
|
|
|
include_examples 'timeouts'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when button mode is active' do
|
|
|
|
let(:chat_url_type) { 'znuny_open_by_button' }
|
|
|
|
|
|
|
|
include_examples 'open chat with button'
|
|
|
|
include_examples 'chat button is hidden after idle timeout'
|
|
|
|
end
|
2021-08-13 22:05:18 +00:00
|
|
|
end
|
2021-07-16 13:00:49 +00:00
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
context 'when no-jquery variant is used' do
|
2021-09-01 07:22:36 +00:00
|
|
|
let(:chat_url_type) { 'znuny-no-jquery' }
|
|
|
|
|
|
|
|
context 'when normal mode is used' do
|
|
|
|
include_examples 'chat messages'
|
|
|
|
include_examples 'timeouts'
|
|
|
|
end
|
2021-07-16 13:00:49 +00:00
|
|
|
|
2021-09-01 07:22:36 +00:00
|
|
|
context 'when button mode is active' do
|
|
|
|
let(:chat_url_type) { 'znuny-no-jquery-open_by_button' }
|
|
|
|
|
|
|
|
include_examples 'open chat with button'
|
|
|
|
include_examples 'chat button is hidden after idle timeout'
|
|
|
|
end
|
2021-07-16 13:00:49 +00:00
|
|
|
end
|
2021-10-14 14:21:06 +00:00
|
|
|
|
|
|
|
describe "Chat can't be closed after timeout #2471", authenticated_as: :authenticate do
|
|
|
|
shared_examples 'test issue #2471' do
|
|
|
|
it 'is able to close to the dialog after a idleTimeout happened' do
|
|
|
|
click agent_chat_switch_selector
|
2022-03-04 13:49:17 +00:00
|
|
|
using_session :customer do
|
|
|
|
|
|
|
|
visit chat_url
|
|
|
|
click '.zammad-chat .js-chat-open'
|
|
|
|
expect(page).to have_selector('.js-restart', wait: 60)
|
|
|
|
click '.js-chat-toggle .zammad-chat-header-icon'
|
|
|
|
expect(page).to have_no_selector('zammad-chat-is-open', wait: 60)
|
|
|
|
end
|
2021-10-14 14:21:06 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with jquery' do
|
|
|
|
include_examples 'test issue #2471'
|
|
|
|
end
|
|
|
|
|
2022-03-04 13:49:17 +00:00
|
|
|
context 'without jquery' do
|
2021-10-14 14:21:06 +00:00
|
|
|
let(:chat_url_type) { 'znuny-no-jquery' }
|
|
|
|
|
|
|
|
include_examples 'test issue #2471'
|
|
|
|
end
|
|
|
|
end
|
2021-11-04 15:35:24 +00:00
|
|
|
|
|
|
|
context 'when image is present in chat message', authenticated_as: :authenticate do
|
|
|
|
let(:chat) { create(:chat) }
|
|
|
|
let(:chat_user) { create(:agent) }
|
|
|
|
let(:chat_session) { create(:'chat/session', user: chat_user, chat: chat) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
file = File.binread(Rails.root.join('spec/fixtures/image/squares.png'))
|
|
|
|
base64 = Base64.encode64(file).delete("\n")
|
|
|
|
|
|
|
|
create(
|
|
|
|
:'chat/message',
|
|
|
|
chat_session: chat_session,
|
|
|
|
content: "With inline image: <img src='data:image/png;base64,#{base64}' style='width: 100%; max-width: 460px;'>"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when image preview is used' do
|
|
|
|
it 'use image preview' do
|
|
|
|
visit "#customer_chat/session/#{chat_session.id}"
|
|
|
|
|
|
|
|
click '.chat-body .chat-message img'
|
|
|
|
|
|
|
|
modal_ready
|
|
|
|
|
|
|
|
expect(page).to have_css('.js-submit', text: 'Download')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-07-16 13:00:49 +00:00
|
|
|
end
|