2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-12-19 14:47:15 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Richtext', type: :system do
|
|
|
|
|
2019-04-15 01:41:17 +00:00
|
|
|
before do
|
2018-12-19 14:47:15 +00:00
|
|
|
click(:href, '#current_user')
|
|
|
|
click(:href, '#layout_ref')
|
|
|
|
click(:href, '#layout_ref/richtext')
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'Richtext' do
|
|
|
|
|
2019-04-15 01:41:17 +00:00
|
|
|
it 'Single line mode' do
|
2018-12-19 14:47:15 +00:00
|
|
|
|
|
|
|
element = find('#content .text-1')
|
|
|
|
|
|
|
|
element.send_keys(
|
|
|
|
'some test for browser ',
|
|
|
|
:enter,
|
|
|
|
'and some other for browser'
|
|
|
|
)
|
|
|
|
|
|
|
|
expect(element).to have_content('some test for browser and some other for browser')
|
|
|
|
end
|
|
|
|
|
2019-04-15 01:41:17 +00:00
|
|
|
it 'Multi line mode' do
|
2018-12-19 14:47:15 +00:00
|
|
|
|
|
|
|
element = find('#content .text-5')
|
|
|
|
|
|
|
|
element.send_keys(
|
|
|
|
'some test for browser ',
|
|
|
|
:enter,
|
|
|
|
'and some other for browser'
|
|
|
|
)
|
|
|
|
|
2021-05-12 11:37:44 +00:00
|
|
|
expect(element).to have_content(%r{some test for browser\s?\nand some other for browser})
|
2018-12-19 14:47:15 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'Regular text' do
|
|
|
|
|
2019-04-15 01:41:17 +00:00
|
|
|
it 'Multi line mode' do
|
2018-12-19 14:47:15 +00:00
|
|
|
|
|
|
|
element = find('#content .text-3')
|
|
|
|
|
|
|
|
element.send_keys(
|
|
|
|
'some test for browser ',
|
|
|
|
:enter,
|
|
|
|
'and some other for browser'
|
|
|
|
)
|
|
|
|
|
2021-05-12 11:37:44 +00:00
|
|
|
expect(element).to have_content(%r{some test for browser\s?\nand some other for browser})
|
2018-12-19 14:47:15 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|