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
Show 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
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
mountComponent
from
'
helpers/vue_mount_component_helper
'
;
import
MrWidgetMerging
from
'
~/vue_merge_request_widget/components/states/mr_widget_merging.vue
'
;
import
mergingComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_merging.vue
'
;
describe
(
'
MRWidgetMerging
'
,
()
=>
{
describe
(
'
MRWidgetMerging
'
,
()
=>
{
let
vm
;
let
wrapper
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
mergingComponent
);
vm
=
mountComponent
(
Component
,
{
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
MrWidgetMerging
,
{
propsData
:
{
mr
:
{
mr
:
{
targetBranchPath
:
'
/branch-path
'
,
targetBranchPath
:
'
/branch-path
'
,
targetBranch
:
'
branch
'
,
targetBranch
:
'
branch
'
,
},
},
},
});
});
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
vm
.
$
destroy
();
wrapper
.
destroy
();
});
});
it
(
'
renders information about merge request being merged
'
,
()
=>
{
it
(
'
renders information about merge request being merged
'
,
()
=>
{
expect
(
expect
(
vm
.
$el
wrapper
.
querySelector
(
'
.media-body
'
)
.
find
(
'
.media-body
'
)
.
textContent
.
trim
()
.
text
()
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
)
.
replace
(
/
\s\s
+/g
,
'
'
)
.
replace
(
/
[\r\n]
+/g
,
'
'
),
.
replace
(
/
[\r\n]
+/g
,
'
'
),
).
toContain
(
'
This merge request is in the process of being merged
'
);
).
toContain
(
'
This merge request is in the process of being merged
'
);
...
@@ -31,13 +32,14 @@ describe('MRWidgetMerging', () => {
...
@@ -31,13 +32,14 @@ describe('MRWidgetMerging', () => {
it
(
'
renders branch information
'
,
()
=>
{
it
(
'
renders branch information
'
,
()
=>
{
expect
(
expect
(
vm
.
$el
wrapper
.
querySelector
(
'
.mr-info-list
'
)
.
find
(
'
.mr-info-list
'
)
.
textContent
.
trim
()
.
text
()
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
)
.
replace
(
/
\s\s
+/g
,
'
'
)
.
replace
(
/
[\r\n]
+/g
,
'
'
),
.
replace
(
/
[\r\n]
+/g
,
'
'
),
).
toEqual
(
'
The changes will be merged into branch
'
);
).
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