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
acb64db8
Commit
acb64db8
authored
Oct 03, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tests for mr_widget_rebase component
parent
3b02a3e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
1 deletion
+79
-1
ee/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
...rge_request_widget/components/states/mr_widget_rebase.vue
+1
-1
spec/javascripts/vue_mr_widget/components/mr_widget_rebase_spec.js
...scripts/vue_mr_widget/components/mr_widget_rebase_spec.js
+78
-0
No files found.
ee/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
View file @
acb64db8
...
...
@@ -124,7 +124,7 @@
branch into source branch to allow this merge request to be merged.
</span>
<span
v-
if=
"renderError"
v-
else
class=
"bold danger"
>
{{
rebasingError
}}
</span>
...
...
spec/javascripts/vue_mr_widget/components/mr_widget_rebase_spec.js
0 → 100644
View file @
acb64db8
import
Vue
from
'
vue
'
;
import
component
from
'
ee/vue_merge_request_widget/components/states/mr_widget_rebase.vue
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
describe
(
'
Merge request widget rebase component
'
,
()
=>
{
let
Component
;
let
vm
;
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
While rebasing
'
,
()
=>
{
it
(
'
should show progress message
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
mr
:
{
rebaseInProgress
:
true
},
service
:
{},
});
expect
(
vm
.
$el
.
querySelector
(
'
.rebase-state-find-class-convention span
'
).
textContent
.
trim
(),
).
toContain
(
'
Rebase in progress
'
);
});
});
describe
(
'
With permissions
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
mr
:
{
rebaseInProgress
:
false
,
canPushToSourceBranch
:
true
,
},
service
:
{},
});
});
it
(
'
it should render rebase button and warning message
'
,
()
=>
{
const
text
=
vm
.
$el
.
querySelector
(
'
.rebase-state-find-class-convention span
'
).
textContent
.
trim
();
expect
(
text
).
toContain
(
'
Fast-forward merge is not possible.
'
);
expect
(
text
).
toContain
(
'
Rebase the source branch onto the target branch or merge target
'
);
expect
(
text
).
toContain
(
'
branch into source branch to allow this merge request to be merged.
'
);
});
it
(
'
it should render error message when it fails
'
,
(
done
)
=>
{
vm
.
rebasingError
=
'
Something went wrong!
'
;
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.rebase-state-find-class-convention span
'
).
textContent
.
trim
(),
).
toContain
(
'
Something went wrong!
'
);
done
();
});
});
});
describe
(
'
Without permissions
'
,
()
=>
{
it
(
'
should render a message explaining user does not have permissions
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
mr
:
{
rebaseInProgress
:
false
,
canPushToSourceBranch
:
false
,
targetBranch
:
'
foo
'
,
},
service
:
{},
});
const
text
=
vm
.
$el
.
querySelector
(
'
.rebase-state-find-class-convention span
'
).
textContent
.
trim
();
expect
(
text
).
toContain
(
'
Fast-forward merge is not possible.
'
);
expect
(
text
).
toContain
(
'
Rebase the source branch onto
'
);
expect
(
text
).
toContain
(
'
foo
'
);
expect
(
text
).
toContain
(
'
to allow this merge request to be merged.
'
);
});
});
});
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