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
Léo-Paul Géneau
gitlab-ce
Commits
9b760c4c
Commit
9b760c4c
authored
Jun 15, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added getter spec for preBuiltCommitMessage
parent
44484cfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/javascripts/ide/stores/modules/commit/getters_spec.js
spec/javascripts/ide/stores/modules/commit/getters_spec.js
+44
-0
No files found.
spec/javascripts/ide/stores/modules/commit/getters_spec.js
View file @
9b760c4c
...
@@ -81,4 +81,48 @@ describe('IDE commit module getters', () => {
...
@@ -81,4 +81,48 @@ describe('IDE commit module getters', () => {
});
});
});
});
});
});
describe
(
'
preBuiltCommitMessage
'
,
()
=>
{
let
rootState
=
{};
beforeEach
(()
=>
{
rootState
.
changedFiles
=
[];
rootState
.
stagedFiles
=
[];
});
afterEach
(()
=>
{
rootState
=
{};
});
it
(
'
returns commitMessage when set
'
,
()
=>
{
state
.
commitMessage
=
'
test commit message
'
;
expect
(
getters
.
preBuiltCommitMessage
(
state
,
null
,
rootState
)).
toBe
(
'
test commit message
'
);
});
[
'
changedFiles
'
,
'
stagedFiles
'
].
forEach
(
key
=>
{
it
(
'
returns commitMessage with updated file
'
,
()
=>
{
rootState
[
key
].
push
({
path
:
'
test-file
'
,
});
expect
(
getters
.
preBuiltCommitMessage
(
state
,
null
,
rootState
)).
toBe
(
'
Update test-file
'
);
});
it
(
'
returns commitMessage with updated files
'
,
()
=>
{
rootState
[
key
].
push
(
{
path
:
'
test-file
'
,
},
{
path
:
'
index.js
'
,
},
);
expect
(
getters
.
preBuiltCommitMessage
(
state
,
null
,
rootState
)).
toBe
(
'
Update test-file, index.js files
'
,
);
});
});
});
});
});
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