Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 18:09:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 18:09:11 +0300
commit0eb3d2f799ce4f4de87fb9fc6fd98e592323bc89 (patch)
treefd70d5bc63fe152e0a67aaa5a70e4c9f16dc6ffc /spec
parent5564275a0b378298dc6281599cbfe71a937109ff (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/ide/stores/mutations/file_spec.js29
-rw-r--r--spec/frontend/ide/stores/mutations_spec.js20
-rw-r--r--spec/frontend/repository/components/breadcrumbs_spec.js11
-rw-r--r--spec/frontend/repository/components/table/parent_row_spec.js7
-rw-r--r--spec/frontend/repository/components/table/row_spec.js16
-rw-r--r--spec/javascripts/ide/stores/actions_spec.js13
-rw-r--r--spec/models/project_spec.rb6
7 files changed, 75 insertions, 27 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}
diff --git a/spec/javascripts/ide/stores/actions_spec.js b/spec/javascripts/ide/stores/actions_spec.js
index d582462d542..4e65a7b0673 100644
--- a/spec/javascripts/ide/stores/actions_spec.js
+++ b/spec/javascripts/ide/stores/actions_spec.js
@@ -591,11 +591,7 @@ describe('Multi-file store actions', () => {
'path',
store.state,
[{ type: types.DELETE_ENTRY, payload: 'path' }],
- [
- { type: 'burstUnusedSeal' },
- { type: 'stageChange', payload: 'path' },
- { type: 'triggerFilesChange' },
- ],
+ [{ type: 'stageChange', payload: 'path' }, { type: 'triggerFilesChange' }],
done,
);
});
@@ -623,7 +619,6 @@ describe('Multi-file store actions', () => {
store.state,
[{ type: types.DELETE_ENTRY, payload: 'testFolder/entry-to-delete' }],
[
- { type: 'burstUnusedSeal' },
{ type: 'stageChange', payload: 'testFolder/entry-to-delete' },
{ type: 'triggerFilesChange' },
],
@@ -688,11 +683,7 @@ describe('Multi-file store actions', () => {
testEntry.path,
store.state,
[{ type: types.DELETE_ENTRY, payload: testEntry.path }],
- [
- { type: 'burstUnusedSeal' },
- { type: 'stageChange', payload: testEntry.path },
- { type: 'triggerFilesChange' },
- ],
+ [{ type: 'stageChange', payload: testEntry.path }, { type: 'triggerFilesChange' }],
done,
);
});
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 635db5a73cb..fdcee973fa7 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -3691,7 +3691,7 @@ describe Project do
end
end
- describe '.wrap_authorized_projects_with_cte' do
+ describe '.wrap_with_cte' do
let!(:user) { create(:user) }
let!(:private_project) do
@@ -3702,10 +3702,10 @@ describe Project do
let(:projects) { described_class.all.public_or_visible_to_user(user) }
- subject { described_class.wrap_authorized_projects_with_cte(projects) }
+ subject { described_class.wrap_with_cte(projects) }
it 'wrapped query matches original' do
- expect(subject.to_sql).to match(/^WITH "authorized_projects" AS/)
+ expect(subject.to_sql).to match(/^WITH "projects_cte" AS/)
expect(subject).to match_array(projects)
end
end