summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/features/content_editor_shared_examples.rb
blob: 2332285540a932b5121d4d1c20a0d02ffaf24fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

RSpec.shared_examples 'edits content using the content editor' do
  it 'formats text as bold using bubble menu' do
    content_editor_testid = '[data-testid="content-editor"] [contenteditable]'

    expect(page).to have_css(content_editor_testid)

    find(content_editor_testid).send_keys 'Typing text in the content editor'
    find(content_editor_testid).send_keys [:shift, :left]

    expect(page).to have_css('[data-testid="formatting-bubble-menu"]')
  end
end