Commit 3bbaa9ec authored by Kushal Pandya's avatar Kushal Pandya

Add tests to assert sidebar behavior

parent c9b4762e
......@@ -11,6 +11,8 @@ describe 'Assign labels to an epic', :js do
stub_licensed_features(epics: true)
sign_in(user)
set_cookie('collapsed_gutter', 'true')
visit group_epic_path(group, epic)
end
......@@ -30,4 +32,33 @@ describe 'Assign labels to an epic', :js do
end
end
end
context 'when labels icon is clicked on collapsed sidebar' do
before do
page.within('aside.right-sidebar') do
find('.fa-tags').click
end
wait_for_requests
end
it 'expands sidebar' do
page.within('.content-wrapper .content') do
expect(page).to have_css('.right-sidebar-expanded')
end
end
it 'opens labels dropdown' do
page.within('aside.right-sidebar') do
expect(page).to have_css('.js-selectbox .dropdown.open')
end
end
it 'collapses sidebar when clicked outside' do
page.within('.content-wrapper') do
find('.content').click
expect(page).to have_css('.right-sidebar-collapsed')
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment