Fix for diff_file specs
This commit is contained in:
parent
259e54402a
commit
3e9965f767
2 changed files with 10 additions and 1 deletions
|
@ -22,11 +22,18 @@ describe('DiffFile', () => {
|
|||
|
||||
expect(el.id).toEqual(fileHash);
|
||||
expect(el.classList.contains('diff-file')).toEqual(true);
|
||||
|
||||
expect(el.querySelectorAll('.diff-content.hidden').length).toEqual(0);
|
||||
expect(el.querySelector('.js-file-title')).toBeDefined();
|
||||
expect(el.querySelector('.file-title-name').innerText.indexOf(filePath) > -1).toEqual(true);
|
||||
expect(el.querySelector('.js-syntax-highlight')).toBeDefined();
|
||||
expect(el.querySelectorAll('.line_content').length > 5).toEqual(true);
|
||||
|
||||
expect(vm.file.renderIt).toEqual(false);
|
||||
vm.file.renderIt = true;
|
||||
|
||||
vm.$nextTick(() => {
|
||||
expect(el.querySelectorAll('.line_content').length > 5).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('collapsed', () => {
|
||||
|
@ -34,6 +41,7 @@ describe('DiffFile', () => {
|
|||
expect(vm.$el.querySelectorAll('.diff-content').length).toEqual(1);
|
||||
expect(vm.file.collapsed).toEqual(false);
|
||||
vm.file.collapsed = true;
|
||||
vm.file.renderIt = true;
|
||||
|
||||
vm.$nextTick(() => {
|
||||
expect(vm.$el.querySelectorAll('.diff-content').length).toEqual(0);
|
||||
|
|
|
@ -39,6 +39,7 @@ export default {
|
|||
viewPath: '/gitlab-org/gitlab-test/blob/spooky-stuff/CHANGELOG',
|
||||
replacedViewPath: null,
|
||||
collapsed: false,
|
||||
renderIt: false,
|
||||
tooLarge: false,
|
||||
contextLinesPath:
|
||||
'/gitlab-org/gitlab-test/blob/c48ee0d1bf3b30453f5b32250ce03134beaa6d13/CHANGELOG/diff',
|
||||
|
|
Loading…
Reference in a new issue