Merge branch 'mr-side-by-side-breadcrumbs-container' into 'master'

Stop breadcrumbs changing container when in side-by-side diff

Closes #37641

See merge request gitlab-org/gitlab-ce!14454
This commit is contained in:
Filipa Lacerda 2017-09-27 09:34:53 +00:00
commit 9034227749
3 changed files with 29 additions and 1 deletions

View File

@ -352,7 +352,7 @@ import {
}
expandViewContainer() {
const $wrapper = $('.content-wrapper .container-fluid');
const $wrapper = $('.content-wrapper .container-fluid').not('.breadcrumbs');
if (this.fixedLayoutPref === null) {
this.fixedLayoutPref = $wrapper.hasClass('container-limited');
}

View File

@ -0,0 +1,5 @@
---
title: Fixed breadcrumbs container expanding in side-by-side diff view
merge_request:
author:
type: fixed

View File

@ -416,5 +416,28 @@ import 'vendor/jquery.scrollTo';
});
});
});
describe('expandViewContainer', function () {
beforeEach(() => {
$('body').append('<div class="content-wrapper"><div class="container-fluid container-limited"></div></div>');
});
afterEach(() => {
$('.content-wrapper').remove();
});
it('removes container-limited from containers', function () {
this.class.expandViewContainer();
expect($('.content-wrapper')).not.toContainElement('.container-limited');
});
it('does remove container-limited from breadcrumbs', function () {
$('.container-limited').addClass('breadcrumbs');
this.class.expandViewContainer();
expect($('.content-wrapper')).toContainElement('.container-limited');
});
});
});
}).call(window);