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
Léo-Paul Géneau
gitlab-ce
Commits
18091353
Commit
18091353
authored
Aug 09, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] Adds tests for issue_note_edited_text component
parent
d37881b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
app/assets/javascripts/notes/components/issue_note_edited_text.vue
...s/javascripts/notes/components/issue_note_edited_text.vue
+2
-1
spec/javascripts/notes/components/issue_note_edited_text_spec.js
...vascripts/notes/components/issue_note_edited_text_spec.js
+35
-5
No files found.
app/assets/javascripts/notes/components/issue_note_edited_text.vue
View file @
18091353
...
...
@@ -2,6 +2,7 @@
import
timeAgoTooltip
from
'
../../vue_shared/components/time_ago_tooltip.vue
'
;
export
default
{
name
:
'
editedNoteText
'
,
props
:
{
actionText
:
{
type
:
String
,
...
...
@@ -37,7 +38,7 @@
by
<a
:href=
"editedBy.path"
class=
"author_link"
>
class=
"
js-vue-author
author_link"
>
{{
editedBy
.
name
}}
</a>
</div>
...
...
spec/javascripts/notes/components/issue_note_edited_text_spec.js
View file @
18091353
import
Vue
from
'
vue
'
;
import
issueNoteEditedText
from
'
~/notes/components/issue_note_edited_text.vue
'
;
describe
(
'
issue_note_edited_text
'
,
()
=>
{
it
(
'
should render block with provided className
'
,
()
=>
{
let
vm
;
let
props
;
});
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
issueNoteEditedText
);
props
=
{
actionText
:
'
Edited
'
,
className
:
'
foo-bar
'
,
editedAt
:
'
2017-08-04T09:52:31.062Z
'
,
editedBy
:
{
avatar_url
:
'
path
'
,
id
:
1
,
name
:
'
Root
'
,
path
:
'
/root
'
,
state
:
'
active
'
,
username
:
'
root
'
,
},
};
it
(
'
should render provided actionText
'
,
()
=>
{
vm
=
new
Component
({
propsData
:
props
,
}).
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
should render time ago with provided timestamp
'
,
()
=>
{
it
(
'
should render block with provided className
'
,
()
=>
{
expect
(
vm
.
$el
.
className
).
toEqual
(
props
.
className
);
});
it
(
'
should render provided actionText
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
props
.
actionText
);
});
it
(
'
should render provided user information
'
,
()
=>
{
const
authorLink
=
vm
.
$el
.
querySelector
(
'
.js-vue-author
'
);
expect
(
authorLink
.
getAttribute
(
'
href
'
)).
toEqual
(
props
.
editedBy
.
path
);
expect
(
authorLink
.
textContent
.
trim
()).
toEqual
(
props
.
editedBy
.
name
);
});
});
\ No newline at end of file
});
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