Commit d93d1f9e authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray Committed by Phil Hughes

Check for sidebar cookie instead of class when resizing window

parent ce14fae5
......@@ -68,7 +68,7 @@ export default class NewNavSidebar {
if (breakpoint === 'sm' || breakpoint === 'md') {
this.toggleCollapsedSidebar(true);
} else if (breakpoint === 'lg') {
const collapse = this.$sidebar.hasClass('sidebar-icons-only');
const collapse = Cookies.get('sidebar_collapsed') === 'true';
this.toggleCollapsedSidebar(collapse);
}
}
......
......@@ -13,7 +13,7 @@ describe 'Issue Boards', js: true do
project.team << [user, :master]
project.team << [user2, :master]
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
page.driver.set_cookie('sidebar_collapsed', 'true')
sign_in(user)
end
......
......@@ -28,7 +28,7 @@ describe 'Visual tokens', js: true do
sign_in(user)
create(:issue, project: project)
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
page.driver.set_cookie('sidebar_collapsed', 'true')
visit project_issues_path(project)
end
......
......@@ -22,7 +22,7 @@ feature 'Diff note avatars', js: true do
project.team << [user, :master]
sign_in user
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
page.driver.set_cookie('sidebar_collapsed', 'true')
end
context 'discussion tab' do
......
......@@ -6,7 +6,7 @@ feature 'Merge requests > User posts diff notes', :js do
let(:project) { merge_request.source_project }
before do
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
page.driver.set_cookie('sidebar_collapsed', 'true')
project.add_developer(user)
sign_in(user)
......
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