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
e03472d0
Commit
e03472d0
authored
Mar 12, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate mr_widget_merging to VTU
parent
195d5f87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js
...vue_mr_widget/components/states/mr_widget_merging_spec.js
+20
-18
No files found.
spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js
View file @
e03472d0
import
Vue
from
'
vue
'
;
import
mountComponent
from
'
helpers/vue_mount_component_helper
'
;
import
mergingComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_merging.vue
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MrWidgetMerging
from
'
~/vue_merge_request_widget/components/states/mr_widget_merging.vue
'
;
describe
(
'
MRWidgetMerging
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
mergingComponent
);
let
wrapper
;
vm
=
mountComponent
(
Component
,
{
mr
:
{
targetBranchPath
:
'
/branch-path
'
,
targetBranch
:
'
branch
'
,
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
MrWidgetMerging
,
{
propsData
:
{
mr
:
{
targetBranchPath
:
'
/branch-path
'
,
targetBranch
:
'
branch
'
,
},
},
});
});
afterEach
(()
=>
{
vm
.
$
destroy
();
wrapper
.
destroy
();
});
it
(
'
renders information about merge request being merged
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.media-body
'
)
.
textContent
.
trim
()
wrapper
.
find
(
'
.media-body
'
)
.
text
()
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
)
.
replace
(
/
[\r\n]
+/g
,
'
'
),
).
toContain
(
'
This merge request is in the process of being merged
'
);
...
...
@@ -31,13 +32,14 @@ describe('MRWidgetMerging', () => {
it
(
'
renders branch information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.mr-info-list
'
)
.
textContent
.
trim
()
wrapper
.
find
(
'
.mr-info-list
'
)
.
text
()
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
)
.
replace
(
/
[\r\n]
+/g
,
'
'
),
).
toEqual
(
'
The changes will be merged into branch
'
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/branch-path
'
);
expect
(
wrapper
.
find
(
'
a
'
).
attributes
(
'
href
'
)).
toBe
(
'
/branch-path
'
);
});
});
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