Commit 0315cfc0 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'selected-state-commit-view' into 'master'

Add selected state for diff view in commit page

See merge request gitlab-org/gitlab!54762
parents f3f863d8 d7a383ff
......@@ -232,7 +232,7 @@ module DiffHelper
# Always use HTML to handle case where JSON diff rendered this button
params_copy.delete(:format)
link_to url_for(params_copy), id: "#{name}-diff-btn", class: (selected ? 'btn gl-button active' : 'btn gl-button'), data: { view_type: name } do
link_to url_for(params_copy), id: "#{name}-diff-btn", class: (selected ? 'btn gl-button btn-default selected' : 'btn gl-button btn-default'), data: { view_type: name } do
title
end
end
......
---
title: Add selected state for diff view in commit page
merge_request: 54762
author: Yogi (@yo)
type: changed
......@@ -121,14 +121,14 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do
click_link 'Changes'
expect(page).to have_css('a.btn.active', text: 'Inline')
expect(page).not_to have_css('a.btn.active', text: 'Side-by-side')
expect(page).to have_css('a.btn.selected', text: 'Inline')
expect(page).not_to have_css('a.btn.selected', text: 'Side-by-side')
click_link 'Side-by-side'
within '.merge-request' do
expect(page).not_to have_css('a.btn.active', text: 'Inline')
expect(page).to have_css('a.btn.active', text: 'Side-by-side')
expect(page).not_to have_css('a.btn.selected', text: 'Inline')
expect(page).to have_css('a.btn.selected', text: 'Side-by-side')
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