Commit 9739e45a authored by Mike Greiling's avatar Mike Greiling

Fix broken karma specs

parent 47774152
...@@ -67,7 +67,7 @@ describe('detailedMetric', () => { ...@@ -67,7 +67,7 @@ describe('detailedMetric', () => {
vm.$el vm.$el
.querySelectorAll('.performance-bar-modal td:nth-child(3)') .querySelectorAll('.performance-bar-modal td:nth-child(3)')
.forEach((request, index) => { .forEach((request, index) => {
expect(request.innerText).toContain(requestDetails[index].request); expect(request.innerText).toEqual(requestDetails[index].request);
}); });
}); });
......
...@@ -44,7 +44,10 @@ describe('Merge request widget rebase component', () => { ...@@ -44,7 +44,10 @@ describe('Merge request widget rebase component', () => {
.textContent.trim(); .textContent.trim();
expect(text).toContain('Fast-forward merge is not possible.'); expect(text).toContain('Fast-forward merge is not possible.');
expect(text).toContain('Rebase the source branch onto the target branch or merge target'); expect(text.replace(/\s\s+/g, ' ')).toContain(
'Rebase the source branch onto the target branch or merge target',
);
expect(text).toContain('branch into source branch to allow this merge request to be merged.'); expect(text).toContain('branch into source branch to allow this merge request to be merged.');
}); });
...@@ -78,7 +81,7 @@ describe('Merge request widget rebase component', () => { ...@@ -78,7 +81,7 @@ describe('Merge request widget rebase component', () => {
expect(text).toContain('Fast-forward merge is not possible.'); expect(text).toContain('Fast-forward merge is not possible.');
expect(text).toContain('Rebase the source branch onto'); expect(text).toContain('Rebase the source branch onto');
expect(text).toContain('foo'); expect(text).toContain('foo');
expect(text).toContain('to allow this merge request to be merged.'); expect(text.replace(/\s\s+/g, ' ')).toContain('to allow this merge request to be merged.');
}); });
}); });
......
...@@ -33,7 +33,7 @@ describe('MRWidgetMissingBranch', () => { ...@@ -33,7 +33,7 @@ describe('MRWidgetMissingBranch', () => {
expect(el.classList.contains('mr-widget-body')).toBeTruthy(); expect(el.classList.contains('mr-widget-body')).toBeTruthy();
expect(el.querySelector('button').getAttribute('disabled')).toBeTruthy(); expect(el.querySelector('button').getAttribute('disabled')).toBeTruthy();
expect(content).toContain('source branch does not exist.'); expect(content.replace(/\s\s+/g, ' ')).toContain('source branch does not exist.');
expect(content).toContain('Please restore it or use a different source branch'); expect(content).toContain('Please restore it or use a different source branch');
}); });
}); });
......
...@@ -19,7 +19,9 @@ describe('NothingToMerge', () => { ...@@ -19,7 +19,9 @@ describe('NothingToMerge', () => {
"Currently there are no changes in this merge request's source branch", "Currently there are no changes in this merge request's source branch",
); );
expect(vm.$el.innerText).toContain('Please push new commits or use a different branch.'); expect(vm.$el.innerText.replace(/\s\s+/g, ' ')).toContain(
'Please push new commits or use a different branch.',
);
}); });
it('should not show new blob link if there is no link available', () => { it('should not show new blob link if there is no link available', () => {
......
...@@ -85,7 +85,9 @@ describe('Wip', () => { ...@@ -85,7 +85,9 @@ describe('Wip', () => {
expect(el.innerText).toContain('This is a Work in Progress'); expect(el.innerText).toContain('This is a Work in Progress');
expect(el.querySelector('button').getAttribute('disabled')).toBeTruthy(); expect(el.querySelector('button').getAttribute('disabled')).toBeTruthy();
expect(el.querySelector('button').innerText).toContain('Merge'); expect(el.querySelector('button').innerText).toContain('Merge');
expect(el.querySelector('.js-remove-wip').innerText).toContain('Resolve WIP status'); expect(el.querySelector('.js-remove-wip').innerText.replace(/\s\s+/g, ' ')).toContain(
'Resolve WIP status',
);
}); });
it('should not show removeWIP button is user cannot update MR', done => { it('should not show removeWIP button is user cannot update MR', done => {
......
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