Sha256: d7d7a8f2db2e0bf019c7dd31a2c515010e31af02de4145a45f8dec8d2434fb2f

Contents?: true

Size: 1.3 KB

Versions: 18

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

feature 'Editing the Home Page', js: true, versioning: true do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }

  before { login_as admin }

  it 'does not have a search results widget' do
    visit spotlight.edit_exhibit_home_page_path(exhibit)
    click_add_widget
    expect(page).to have_css("[data-type='solr_documents']", visible: true)
    expect(page).not_to have_css("[data-type='search_results']", visible: true)
  end

  it 'correctly saves a list widget' do
    visit spotlight.edit_exhibit_home_page_path(exhibit)
    click_add_widget
    expect(page).to have_css('button.st-block-controls__button')

    find("button[data-type='list']").click
    expect(page).to have_css('ul.st-list-block__list')
    expect(page).to have_css('li.st-list-block__item')
    expect(page).to have_css('*[contenteditable=true]')
    expect(page).to have_css('div.st-list-block__editor[contenteditable=true]', count: 1)

    first_element = page.all('div.st-list-block__editor[contenteditable=true]').first
    first_element.set('one')

    click_button 'Save changes'
    expect(page).to have_css('div.st__content-block--list ul li', count: 1)
    expect(page).to have_css('div.st__content-block--list ul li', text: 'on')
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.13.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.12.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.12.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.11.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.10.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.9.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.8.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.7.2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.7.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.7.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.6.1.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.6.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.6.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.5.2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.5.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.5.0 spec/features/javascript/home_page_edit_spec.rb