Commit 2cd71073 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'expand-diff-bug' into 'master'

Fixed diff files not expanding

Closes #54868

See merge request gitlab-org/gitlab-ce!23555
parents 00acef43 9afc3069
......@@ -148,7 +148,7 @@ export const scrollToLineIfNeededParallel = (_, line) => {
};
export const loadCollapsedDiff = ({ commit }, file) =>
axios.get(file.loadCollapsedDiffUrl).then(res => {
axios.get(file.load_collapsed_diff_url).then(res => {
commit(types.ADD_COLLAPSED_DIFFS, {
file,
data: res.data,
......
require 'spec_helper'
describe 'User expands diff', :js do
let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
before do
visit(diffs_project_merge_request_path(project, merge_request))
wait_for_requests
end
it 'allows user to expand diff' do
page.within find('[id="19763941ab80e8c09871c0a425f0560d9053bcb3"]') do
click_link 'Click to expand it.'
wait_for_requests
expect(page).not_to have_content('Click to expand it.')
expect(page).to have_selector('.code')
end
end
end
......@@ -379,7 +379,7 @@ describe('DiffsStoreActions', () => {
describe('loadCollapsedDiff', () => {
it('should fetch data and call mutation with response and the give parameter', done => {
const file = { hash: 123, loadCollapsedDiffUrl: '/load/collapsed/diff/url' };
const file = { hash: 123, load_collapsed_diff_url: '/load/collapsed/diff/url' };
const data = { hash: 123, parallelDiffLines: [{ lineCode: 1 }] };
const mock = new MockAdapter(axios);
mock.onGet(file.loadCollapsedDiffUrl).reply(200, data);
......
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