richtext_spec.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Richtext', type: :system do
  4. before do
  5. visit '#layout_ref/richtext'
  6. end
  7. context 'Richtext' do
  8. it 'Single line mode' do
  9. element = find('#content .text-1')
  10. element.send_keys(
  11. 'some test for browser ',
  12. :enter,
  13. 'and some other for browser'
  14. )
  15. expect(element).to have_content('some test for browser and some other for browser')
  16. end
  17. it 'Multi line mode' do
  18. element = find('#content .text-5')
  19. element.send_keys(
  20. 'some test for browser ',
  21. :enter,
  22. 'and some other for browser'
  23. )
  24. expect(element).to have_content(%r{some test for browser\s?\nand some other for browser})
  25. end
  26. end
  27. context 'Regular text' do
  28. it 'Multi line mode' do
  29. element = find('#content .text-3')
  30. element.send_keys(
  31. 'some test for browser ',
  32. :enter,
  33. 'and some other for browser'
  34. )
  35. expect(element).to have_content(%r{some test for browser\s?\nand some other for browser})
  36. end
  37. end
  38. end