Update Mermaid to v8.2.6

This fixes a regression where an underscore in labels no
longer worked:
https://github.com/knsv/mermaid/releases
This commit is contained in:
Stan Hu 2019-09-02 16:50:09 +00:00 committed by Filipa Lacerda
parent fb63a00ea4
commit 526ea7c5b6
3 changed files with 23 additions and 1 deletions

View file

@ -25,6 +25,11 @@ export default endpoint => {
const names = [...document.querySelectorAll('.js-branch-item')].map(
({ dataset }) => dataset.name,
);
if (names.length === 0) {
return true;
}
return axios
.get(endpoint, {
params: { names },

View file

@ -0,0 +1,5 @@
---
title: Skip requesting diverging commit counts if no branches are listed
merge_request: 32496
author:
type: performance

View file

@ -25,13 +25,25 @@ describe('Divergence graph', () => {
mock.restore();
});
it('calls axos get with list of branch names', () =>
it('calls axios get with list of branch names', () =>
init('/-/diverging_counts').then(() => {
expect(axios.get).toHaveBeenCalledWith('/-/diverging_counts', {
params: { names: ['master', 'test/hello-world'] },
});
}));
describe('no branches listed', () => {
beforeEach(() => {
document.body.innerHTML = `<div></div>`;
});
it('avoids requesting diverging commit counts', () => {
expect(axios.get).not.toHaveBeenCalledWith('/-/diverging_counts');
init('/-/diverging_counts');
});
});
it('creates Vue components', () =>
init('/-/diverging_counts').then(() => {
expect(document.querySelector('[data-name="master"]').innerHTML).not.toEqual('');