Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c1d45ab6
Commit
c1d45ab6
authored
Oct 13, 2021
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import commit from fixture
parent
fd6ce34c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
16 deletions
+11
-16
spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js
...ommits_modal/components/add_context_commits_modal_spec.js
+2
-2
spec/frontend/add_context_commits_modal/components/review_tab_container_spec.js
...ext_commits_modal/components/review_tab_container_spec.js
+2
-2
spec/frontend/add_context_commits_modal/store/mutations_spec.js
...rontend/add_context_commits_modal/store/mutations_spec.js
+2
-2
spec/frontend/diffs/components/commit_item_spec.js
spec/frontend/diffs/components/commit_item_spec.js
+2
-2
spec/frontend/diffs/components/compare_versions_spec.js
spec/frontend/diffs/components/compare_versions_spec.js
+3
-3
spec/frontend/diffs/mock_data/diff_with_commit.js
spec/frontend/diffs/mock_data/diff_with_commit.js
+0
-5
No files found.
spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js
View file @
c1d45ab6
import
{
GlModal
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
getDiffWithCommit
from
'
test_fixtures/merge_request_diffs/with_commit.json
'
;
import
AddReviewItemsModal
from
'
~/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue
'
;
import
*
as
actions
from
'
~/add_context_commits_modal/store/actions
'
;
import
mutations
from
'
~/add_context_commits_modal/store/mutations
'
;
import
defaultState
from
'
~/add_context_commits_modal/store/state
'
;
import
getDiffWithCommit
from
'
../../diffs/mock_data/diff_with_commit
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
...
...
@@ -18,7 +18,7 @@ describe('AddContextCommitsModal', () => {
const
removeContextCommits
=
jest
.
fn
();
const
resetModalState
=
jest
.
fn
();
const
searchCommits
=
jest
.
fn
();
const
{
commit
}
=
getDiffWithCommit
()
;
const
{
commit
}
=
getDiffWithCommit
;
const
createWrapper
=
(
props
=
{})
=>
{
store
=
new
Vuex
.
Store
({
...
...
spec/frontend/add_context_commits_modal/components/review_tab_container_spec.js
View file @
c1d45ab6
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
getDiffWithCommit
from
'
test_fixtures/merge_request_diffs/with_commit.json
'
;
import
ReviewTabContainer
from
'
~/add_context_commits_modal/components/review_tab_container.vue
'
;
import
CommitItem
from
'
~/diffs/components/commit_item.vue
'
;
import
getDiffWithCommit
from
'
../../diffs/mock_data/diff_with_commit
'
;
describe
(
'
ReviewTabContainer
'
,
()
=>
{
let
wrapper
;
const
{
commit
}
=
getDiffWithCommit
()
;
const
{
commit
}
=
getDiffWithCommit
;
const
createWrapper
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
ReviewTabContainer
,
{
...
...
spec/frontend/add_context_commits_modal/store/mutations_spec.js
View file @
c1d45ab6
import
getDiffWithCommit
from
'
test_fixtures/merge_request_diffs/with_commit.json
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
*
as
types
from
'
~/add_context_commits_modal/store/mutation_types
'
;
import
mutations
from
'
~/add_context_commits_modal/store/mutations
'
;
import
getDiffWithCommit
from
'
../../diffs/mock_data/diff_with_commit
'
;
describe
(
'
AddContextCommitsModalStoreMutations
'
,
()
=>
{
const
{
commit
}
=
getDiffWithCommit
()
;
const
{
commit
}
=
getDiffWithCommit
;
describe
(
'
SET_BASE_CONFIG
'
,
()
=>
{
it
(
'
should set contextCommitsPath, mergeRequestIid and projectId
'
,
()
=>
{
const
state
=
{};
...
...
spec/frontend/diffs/components/commit_item_spec.js
View file @
c1d45ab6
import
{
mount
}
from
'
@vue/test-utils
'
;
import
getDiffWithCommit
from
'
test_fixtures/merge_request_diffs/with_commit.json
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
Component
from
'
~/diffs/components/commit_item.vue
'
;
import
{
getTimeago
}
from
'
~/lib/utils/datetime_utility
'
;
import
CommitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
getDiffWithCommit
from
'
../mock_data/diff_with_commit
'
;
jest
.
mock
(
'
~/user_popovers
'
);
...
...
@@ -18,7 +18,7 @@ describe('diffs/components/commit_item', () => {
let
wrapper
;
const
timeago
=
getTimeago
();
const
{
commit
}
=
getDiffWithCommit
()
;
const
{
commit
}
=
getDiffWithCommit
;
const
getTitleElement
=
()
=>
wrapper
.
find
(
'
.commit-row-message.item-title
'
);
const
getDescElement
=
()
=>
wrapper
.
find
(
'
pre.commit-row-description
'
);
...
...
spec/frontend/diffs/components/compare_versions_spec.js
View file @
c1d45ab6
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
getDiffWithCommit
from
'
test_fixtures/merge_request_diffs/with_commit.json
'
;
import
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
CompareVersionsComponent
from
'
~/diffs/components/compare_versions.vue
'
;
import
{
createStore
}
from
'
~/mr_notes/stores
'
;
import
getDiffWithCommit
from
'
../mock_data/diff_with_commit
'
;
import
diffsMockData
from
'
../mock_data/merge_request_diffs
'
;
const
localVue
=
createLocalVue
();
...
...
@@ -22,7 +22,7 @@ describe('CompareVersions', () => {
let
wrapper
;
let
store
;
const
targetBranchName
=
'
tmp-wine-dev
'
;
const
{
commit
}
=
getDiffWithCommit
()
;
const
{
commit
}
=
getDiffWithCommit
;
const
createWrapper
=
(
props
=
{},
commitArgs
=
{},
createCommit
=
true
)
=>
{
if
(
createCommit
)
{
...
...
@@ -150,7 +150,7 @@ describe('CompareVersions', () => {
describe
(
'
commit
'
,
()
=>
{
beforeEach
(()
=>
{
store
.
state
.
diffs
.
commit
=
getDiffWithCommit
()
.
commit
;
store
.
state
.
diffs
.
commit
=
getDiffWithCommit
.
commit
;
createWrapper
();
});
...
...
spec/frontend/diffs/mock_data/diff_with_commit.js
deleted
100644 → 0
View file @
fd6ce34c
import
fixture
from
'
test_fixtures/merge_request_diffs/with_commit.json
'
;
export
default
function
getDiffWithCommit
()
{
return
fixture
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment