Commit d7a383ff authored by Yogi's avatar Yogi Committed by Jose Ivan Vargas

Add selected state for diff view in commit page

parent b6486b27
......@@ -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