Sha256: c9b44abc7f3e2ece876be8fb3f9e928b3de6f353fff2eb99fc92c633abdf9da2

Contents?: true

Size: 1.3 KB

Versions: 22

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

describe '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

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.3.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.2.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.1.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.3 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/features/javascript/home_page_edit_spec.rb