Sha256: 36f17687eda3a446e4b69f59f2f3ae82d4ad644ff10ad5681f9693b6935a1080

Contents?: true

Size: 1.27 KB

Versions: 24

Compression:

Stored size: 1.27 KB

Contents

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

24 entries across 24 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.4.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.3.3 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.3.2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.3.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.3.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.2.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.2.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.1.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-1.5.1 spec/features/javascript/home_page_edit_spec.rb
blacklight-spotlight-1.4.1 spec/features/javascript/home_page_edit_spec.rb