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
Boxiang Sun
gitlab-ce
Commits
cc00f468
Commit
cc00f468
authored
Mar 19, 2018
by
George Tsiolis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add i18n and update specs for UnresolvedDiscussions vue component
parent
051e5e99
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
34 deletions
+33
-34
app/assets/javascripts/vue_merge_request_widget/components/states/unresolved_discussions.vue
...quest_widget/components/states/unresolved_discussions.vue
+8
-4
changelogs/unreleased/unresolved-discussions-vue-component-i18n-and-tests.yml
...d/unresolved-discussions-vue-component-i18n-and-tests.yml
+5
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_unresolved_discussions_spec.js
...omponents/states/mr_widget_unresolved_discussions_spec.js
+20
-30
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/unresolved_discussions.vue
View file @
cc00f468
...
@@ -7,7 +7,10 @@ export default {
...
@@ -7,7 +7,10 @@ export default {
statusIcon
,
statusIcon
,
},
},
props
:
{
props
:
{
mr
:
{
type
:
Object
,
required
:
true
},
mr
:
{
type
:
Object
,
required
:
true
,
},
},
},
};
};
</
script
>
</
script
>
...
@@ -20,13 +23,14 @@ export default {
...
@@ -20,13 +23,14 @@ export default {
/>
/>
<div
class=
"media-body space-children"
>
<div
class=
"media-body space-children"
>
<span
class=
"bold"
>
<span
class=
"bold"
>
There are unresolved discussions. Please resolve these discussions
{{
s__
(
"
mrWidget|There are unresolved discussions. Please resolve these discussions
"
)
}}
</span>
</span>
<a
<a
v-if=
"mr.createIssueToResolveDiscussionsPath"
v-if=
"mr.createIssueToResolveDiscussionsPath"
:href=
"mr.createIssueToResolveDiscussionsPath"
:href=
"mr.createIssueToResolveDiscussionsPath"
class=
"btn btn-default btn-xs js-create-issue"
>
class=
"btn btn-default btn-xs js-create-issue"
Create an issue to resolve them later
>
{{
s__
(
"
mrWidget|Create an issue to resolve them later
"
)
}}
</a>
</a>
</div>
</div>
</div>
</div>
...
...
changelogs/unreleased/unresolved-discussions-vue-component-i18n-and-tests.yml
0 → 100644
View file @
cc00f468
---
title
:
Add i18n and update specs for UnresolvedDiscussions vue component
merge_request
:
17866
author
:
George Tsiolis
type
:
performance
spec/javascripts/vue_mr_widget/components/states/mr_widget_unresolved_discussions_spec.js
View file @
cc00f468
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
UnresolvedDiscussions
from
'
~/vue_merge_request_widget/components/states/unresolved_discussions.vue
'
;
import
UnresolvedDiscussions
from
'
~/vue_merge_request_widget/components/states/unresolved_discussions.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
UnresolvedDiscussions
'
,
()
=>
{
describe
(
'
UnresolvedDiscussions
'
,
()
=>
{
describe
(
'
props
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
UnresolvedDiscussions
);
it
(
'
should have props
'
,
()
=>
{
let
vm
;
const
{
mr
}
=
UnresolvedDiscussions
.
props
;
expect
(
mr
.
type
instanceof
Object
).
toBeTruthy
();
afterEach
(()
=>
{
expect
(
mr
.
required
).
toBeTruthy
();
vm
.
$destroy
();
});
});
});
describe
(
'
template
'
,
()
=>
{
describe
(
'
with discussions path
'
,
()
=>
{
let
el
;
let
vm
;
const
path
=
'
foo/bar
'
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
UnresolvedDiscussions
);
vm
=
mountComponent
(
Component
,
{
mr
:
{
const
mr
=
{
createIssueToResolveDiscussionsPath
:
gl
.
TEST_HOST
,
createIssueToResolveDiscussionsPath
:
path
,
}
});
};
vm
=
new
Component
({
el
:
document
.
createElement
(
'
div
'
),
propsData
:
{
mr
},
});
el
=
vm
.
$el
;
});
});
it
(
'
should have correct elements
'
,
()
=>
{
it
(
'
should have correct elements
'
,
()
=>
{
expect
(
el
.
classList
.
contains
(
'
mr-widget-body
'
)).
toBeTruthy
(
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
There are unresolved discussions. Please resolve these discussions
'
);
expect
(
el
.
innerText
).
toContain
(
'
There are unresolved discussions. Please resolve these discussions
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
Create an issue to resolve them later
'
);
expect
(
el
.
innerText
).
toContain
(
'
Create an issue to resolve them later
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-create-issue
'
).
getAttribute
(
'
href
'
)).
toEqual
(
gl
.
TEST_HOST
);
expect
(
el
.
querySelector
(
'
.js-create-issue
'
).
getAttribute
(
'
href
'
)).
toEqual
(
path
);
}
);
});
});
it
(
'
should not show create issue button if user cannot create issue
'
,
(
done
)
=>
{
describe
(
'
without discussions path
'
,
()
=>
{
vm
.
mr
.
createIssueToResolveDiscussionsPath
=
''
;
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
mr
:
{}
});
Vue
.
nextTick
(()
=>
{
expect
(
el
.
querySelector
(
'
.js-create-issue
'
)).
toEqual
(
null
);
done
();
});
});
it
(
'
should not show create issue link if user cannot create issue
'
,
()
=>
{
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
There are unresolved discussions. Please resolve these discussions
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-create-issue
'
)).
toEqual
(
null
);
});
});
});
});
});
});
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