diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 15:09:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 15:09:11 +0000 |
commit | 0eb3d2f799ce4f4de87fb9fc6fd98e592323bc89 (patch) | |
tree | fd70d5bc63fe152e0a67aaa5a70e4c9f16dc6ffc /spec/frontend | |
parent | 5564275a0b378298dc6281599cbfe71a937109ff (diff) | |
download | gitlab-ce-0eb3d2f799ce4f4de87fb9fc6fd98e592323bc89.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
5 files changed, 70 insertions, 13 deletions
diff --git a/spec/frontend/ide/stores/mutations/file_spec.js b/spec/frontend/ide/stores/mutations/file_spec.js index cd308ee9991..9b96b910fcb 100644 --- a/spec/frontend/ide/stores/mutations/file_spec.js +++ b/spec/frontend/ide/stores/mutations/file_spec.js @@ -356,6 +356,14 @@ describe('IDE store file mutations', () => { expect(localState.changedFiles.length).toBe(1); }); + + it('bursts unused seal', () => { + expect(localState.unusedSeal).toBe(true); + + mutations.ADD_FILE_TO_CHANGED(localState, localFile.path); + + expect(localState.unusedSeal).toBe(false); + }); }); describe('REMOVE_FILE_FROM_CHANGED', () => { @@ -366,6 +374,14 @@ describe('IDE store file mutations', () => { expect(localState.changedFiles.length).toBe(0); }); + + it('bursts unused seal', () => { + expect(localState.unusedSeal).toBe(true); + + mutations.REMOVE_FILE_FROM_CHANGED(localState, localFile.path); + + expect(localState.unusedSeal).toBe(false); + }); }); describe.each` @@ -517,6 +533,19 @@ describe('IDE store file mutations', () => { }, ); + describe('STAGE_CHANGE', () => { + it('bursts unused seal', () => { + expect(localState.unusedSeal).toBe(true); + + mutations.STAGE_CHANGE(localState, { + path: localFile.path, + diffInfo: localStore.getters.getDiffInfo(localFile.path), + }); + + expect(localState.unusedSeal).toBe(false); + }); + }); + describe('TOGGLE_FILE_CHANGED', () => { it('updates file changed status', () => { mutations.TOGGLE_FILE_CHANGED(localState, { diff --git a/spec/frontend/ide/stores/mutations_spec.js b/spec/frontend/ide/stores/mutations_spec.js index eb89c92914a..9fe75d596fb 100644 --- a/spec/frontend/ide/stores/mutations_spec.js +++ b/spec/frontend/ide/stores/mutations_spec.js @@ -196,16 +196,6 @@ describe('Multi-file store mutations', () => { }); }); - describe('BURST_UNUSED_SEAL', () => { - it('updates unusedSeal', () => { - expect(localState.unusedSeal).toBe(true); - - mutations.BURST_UNUSED_SEAL(localState); - - expect(localState.unusedSeal).toBe(false); - }); - }); - describe('SET_ERROR_MESSAGE', () => { it('updates error message', () => { mutations.SET_ERROR_MESSAGE(localState, 'error'); @@ -297,6 +287,16 @@ describe('Multi-file store mutations', () => { expect(localState.changedFiles).toEqual([]); }); + + it('bursts unused seal', () => { + localState.entries.test = file('test'); + + expect(localState.unusedSeal).toBe(true); + + mutations.DELETE_ENTRY(localState, 'test'); + + expect(localState.unusedSeal).toBe(false); + }); }); describe('UPDATE_FILE_AFTER_COMMIT', () => { diff --git a/spec/frontend/repository/components/breadcrumbs_spec.js b/spec/frontend/repository/components/breadcrumbs_spec.js index bc2abb3db1a..0271db25468 100644 --- a/spec/frontend/repository/components/breadcrumbs_spec.js +++ b/spec/frontend/repository/components/breadcrumbs_spec.js @@ -33,6 +33,17 @@ describe('Repository breadcrumbs component', () => { expect(vm.findAll(RouterLinkStub).length).toEqual(linkCount); }); + it('escapes hash in directory path', () => { + factory('app/assets/javascripts#'); + + expect( + vm + .findAll(RouterLinkStub) + .at(3) + .props('to'), + ).toEqual('/-/tree//app/assets/javascripts%23'); + }); + it('renders last link as active', () => { factory('app/assets'); diff --git a/spec/frontend/repository/components/table/parent_row_spec.js b/spec/frontend/repository/components/table/parent_row_spec.js index 360c2e97353..904798e0b83 100644 --- a/spec/frontend/repository/components/table/parent_row_spec.js +++ b/spec/frontend/repository/components/table/parent_row_spec.js @@ -31,9 +31,10 @@ describe('Repository parent row component', () => { }); it.each` - path | to - ${'app'} | ${'/-/tree/master/'} - ${'app/assets'} | ${'/-/tree/master/app'} + path | to + ${'app'} | ${'/-/tree/master/'} + ${'app/assets'} | ${'/-/tree/master/app'} + ${'app/assets#/test'} | ${'/-/tree/master/app/assets%23'} `('renders link in $path to $to', ({ path, to }) => { factory(path); diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js index b0c97dee414..71709e7dd83 100644 --- a/spec/frontend/repository/components/table/row_spec.js +++ b/spec/frontend/repository/components/table/row_spec.js @@ -95,6 +95,22 @@ describe('Repository table row component', () => { }); }); + it('pushes new route for directory with hash', () => { + factory({ + id: '1', + sha: '123', + path: 'test#', + type: 'tree', + currentPath: '/', + }); + + return vm.vm.$nextTick().then(() => { + vm.trigger('click'); + + expect($router.push).toHaveBeenCalledWith({ path: '/-/tree/master/test%23' }); + }); + }); + it.each` type | pushes ${'tree'} | ${true} |