BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d14a06da
Unverified
Commit
d14a06da
authored
Apr 19, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec updates
parent
5588efed
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
63 deletions
+8
-63
empty_state.vue
...javascripts/ide/components/commit_sidebar/empty_state.vue
+1
-11
repo_commit_section.vue
...assets/javascripts/ide/components/repo_commit_section.vue
+1
-3
empty_state_spec.js
...scripts/ide/components/commit_sidebar/empty_state_spec.js
+6
-43
getters_spec.js
spec/javascripts/ide/stores/getters_spec.js
+0
-6
No files found.
app/assets/javascripts/ide/components/commit_sidebar/empty_state.vue
View file @
d14a06da
...
...
@@ -10,18 +10,8 @@ export default {
directives
:
{
tooltip
,
},
props
:
{
noChangesStateSvgPath
:
{
type
:
String
,
required
:
true
,
},
committedStateSvgPath
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
...
mapState
([
'lastCommitMsg'
]),
...
mapState
([
'lastCommitMsg'
,
'noChangesStateSvgPath'
,
'committedStateSvgPath'
]),
statusSvg
()
{
return
this
.
lastCommitMsg
?
this
.
committedStateSvgPath
:
this
.
noChangesStateSvgPath
;
},
...
...
app/assets/javascripts/ide/components/repo_commit_section.vue
View file @
d14a06da
...
...
@@ -24,7 +24,7 @@ export default {
tooltip
,
},
computed
:
{
...
mapState
([
'changedFiles'
,
'stagedFiles'
,
'noChangesStateSvgPath'
,
'committedStateSvgPath'
]),
...
mapState
([
'changedFiles'
,
'stagedFiles'
]),
...
mapState
(
'commit'
,
[
'commitMessage'
,
'submitCommitLoading'
]),
...
mapGetters
(
'commit'
,
[
'commitButtonDisabled'
,
'discardDraftButtonDisabled'
,
'branchName'
]),
},
...
...
@@ -108,8 +108,6 @@ export default {
</
template
>
<empty-state
v-else
:no-changes-state-svg-path=
"noChangesStateSvgPath"
:committed-state-svg-path=
"committedStateSvgPath"
/>
</div>
</template>
spec/javascripts/ide/components/commit_sidebar/empty_state_spec.js
View file @
d14a06da
...
...
@@ -10,10 +10,10 @@ describe('IDE commit panel empty state', () => {
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
emptyState
);
vm
=
createComponentWithStore
(
Component
,
store
,
{
noChangesStateSvgPath
:
'no-changes'
,
committedStateSvgPath
:
'committed-state'
,
}
);
Vue
.
set
(
store
.
state
,
'noChangesStateSvgPath'
,
'no-changes'
);
Vue
.
set
(
store
.
state
,
'committedStateSvgPath'
,
'committed-state'
);
vm
=
createComponentWithStore
(
Component
,
store
);
vm
.
$mount
();
});
...
...
@@ -27,9 +27,7 @@ describe('IDE commit panel empty state', () => {
describe
(
'statusSvg'
,
()
=>
{
it
(
'uses noChangesStateSvgPath when commit message is empty'
,
()
=>
{
expect
(
vm
.
statusSvg
).
toBe
(
'no-changes'
);
expect
(
vm
.
$el
.
querySelector
(
'img'
).
getAttribute
(
'src'
)).
toBe
(
'no-changes'
,
);
expect
(
vm
.
$el
.
querySelector
(
'img'
).
getAttribute
(
'src'
)).
toBe
(
'no-changes'
);
});
it
(
'uses committedStateSvgPath when commit message exists'
,
done
=>
{
...
...
@@ -37,9 +35,7 @@ describe('IDE commit panel empty state', () => {
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
statusSvg
).
toBe
(
'committed-state'
);
expect
(
vm
.
$el
.
querySelector
(
'img'
).
getAttribute
(
'src'
)).
toBe
(
'committed-state'
,
);
expect
(
vm
.
$el
.
querySelector
(
'img'
).
getAttribute
(
'src'
)).
toBe
(
'committed-state'
);
done
();
});
...
...
@@ -59,37 +55,4 @@ describe('IDE commit panel empty state', () => {
done
();
});
});
describe
(
'toggle button'
,
()
=>
{
it
(
'calls store action'
,
()
=>
{
spyOn
(
vm
,
'toggleRightPanelCollapsed'
);
vm
.
$el
.
querySelector
(
'.multi-file-commit-panel-collapse-btn'
).
click
();
expect
(
vm
.
toggleRightPanelCollapsed
).
toHaveBeenCalled
();
});
it
(
'renders collapsed class'
,
done
=>
{
vm
.
$el
.
querySelector
(
'.multi-file-commit-panel-collapse-btn'
).
click
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'.is-collapsed'
)).
not
.
toBeNull
();
done
();
});
});
});
describe
(
'collapsed state'
,
()
=>
{
beforeEach
(
done
=>
{
vm
.
$store
.
state
.
rightPanelCollapsed
=
true
;
Vue
.
nextTick
(
done
);
});
it
(
'does not render text & svg'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'img'
)).
toBeNull
();
expect
(
vm
.
$el
.
textContent
).
not
.
toContain
(
'No changes'
);
});
});
});
spec/javascripts/ide/stores/getters_spec.js
View file @
d14a06da
...
...
@@ -37,12 +37,6 @@ describe('IDE store getters', () => {
expect
(
modifiedFiles
.
length
).
toBe
(
1
);
expect
(
modifiedFiles
[
0
].
name
).
toBe
(
'changed'
);
});
it
(
'returns angle left when collapsed'
,
()
=>
{
localState
.
rightPanelCollapsed
=
true
;
expect
(
getters
.
collapseButtonIcon
(
localState
)).
toBe
(
'angle-double-left'
);
});
});
describe
(
'currentMergeRequest'
,
()
=>
{
...
...
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