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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f3e4f10d
Commit
f3e4f10d
authored
Aug 23, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update repo_commit_section to spy service
parent
c5b3632f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
spec/javascripts/repo/components/repo_commit_section_spec.js
spec/javascripts/repo/components/repo_commit_section_spec.js
+5
-6
No files found.
spec/javascripts/repo/components/repo_commit_section_spec.js
View file @
f3e4f10d
import
Vue
from
'
vue
'
;
import
repoCommitSection
from
'
~/repo/components/repo_commit_section.vue
'
;
import
RepoStore
from
'
~/repo/stores/repo_store
'
;
import
Api
from
'
~/api
'
;
import
RepoService
from
'
~/repo/services/repo_service
'
;
describe
(
'
RepoCommitSection
'
,
()
=>
{
f
describe
(
'
RepoCommitSection
'
,
()
=>
{
const
branch
=
'
master
'
;
const
projectUrl
=
'
projectUrl
'
;
const
changedFiles
=
[{
...
...
@@ -111,7 +111,7 @@ describe('RepoCommitSection', () => {
expect
(
submitCommit
.
disabled
).
toBeFalsy
();
spyOn
(
vm
,
'
makeCommit
'
).
and
.
callThrough
();
spyOn
(
Api
,
'
commitMultiple
'
).
and
.
callFake
(()
=>
Promise
.
resolve
());
spyOn
(
RepoService
,
'
commitFiles
'
).
and
.
callFake
(()
=>
Promise
.
resolve
());
submitCommit
.
click
();
...
...
@@ -119,10 +119,9 @@ describe('RepoCommitSection', () => {
expect
(
vm
.
makeCommit
).
toHaveBeenCalled
();
expect
(
submitCommit
.
querySelector
(
'
.fa-spinner.fa-spin
'
)).
toBeTruthy
();
const
args
=
Api
.
commitMultiple
.
calls
.
allArgs
()[
0
];
const
{
commit_message
,
actions
,
branch
:
payloadBranch
}
=
args
[
1
];
const
args
=
RepoService
.
commitFiles
.
calls
.
allArgs
()[
0
];
const
{
commit_message
,
actions
,
branch
:
payloadBranch
}
=
args
[
0
];
expect
(
args
[
0
]).
toBe
(
projectId
);
expect
(
commit_message
).
toBe
(
commitMessage
);
expect
(
actions
.
length
).
toEqual
(
2
);
expect
(
payloadBranch
).
toEqual
(
branch
);
...
...
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