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
7639fb18
Commit
7639fb18
authored
Jul 28, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] Adds tests for placeholder system note
parent
6530035f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
7 deletions
+81
-7
app/assets/javascripts/notes/components/issue_placeholder_note.vue
...s/javascripts/notes/components/issue_placeholder_note.vue
+12
-7
app/assets/javascripts/notes/components/issue_placeholder_system_note.vue
...cripts/notes/components/issue_placeholder_system_note.vue
+1
-0
spec/javascripts/notes/components/issue_placeholder_note_spec.js
...vascripts/notes/components/issue_placeholder_note_spec.js
+43
-0
spec/javascripts/notes/components/issue_placeholder_system_note_spec.js
...ts/notes/components/issue_placeholder_system_note_spec.js
+25
-0
No files found.
app/assets/javascripts/notes/components/issue_placeholder_note.vue
View file @
7639fb18
<
script
>
<
script
>
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
export
default
{
export
default
{
name
:
'
issuePlaceholderNote
'
,
props
:
{
props
:
{
note
:
{
note
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
},
},
components
:
{
userAvatarLink
,
},
data
()
{
data
()
{
return
{
return
{
currentUser
:
window
.
gl
.
curren
tUserData
,
currentUser
:
this
.
$store
.
getters
.
ge
tUserData
,
};
};
},
},
};
};
...
@@ -18,12 +24,11 @@
...
@@ -18,12 +24,11 @@
<li
class=
"note being-posted fade-in-half timeline-entry"
>
<li
class=
"note being-posted fade-in-half timeline-entry"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<div
class=
"timeline-icon"
>
<a
:href=
"currentUser.path"
>
<user-avatar-link
<img
:link-href=
"currentUser.path"
:src=
"currentUser.avatar_url"
:img-src=
"currentUser.avatar_url"
class=
"avatar s40"
:size=
"40"
/>
/>
</a>
</div>
</div>
<div
<div
:class=
"
{ discussion: !note.individual_note }"
:class=
"
{ discussion: !note.individual_note }"
...
...
app/assets/javascripts/notes/components/issue_placeholder_system_note.vue
View file @
7639fb18
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'
placeholderSystemNote
'
,
props
:
{
props
:
{
note
:
{
note
:
{
type
:
Object
,
type
:
Object
,
...
...
spec/javascripts/notes/components/issue_placeholder_note_spec.js
0 → 100644
View file @
7639fb18
import
Vue
from
'
vue
'
;
import
placeholderNote
from
'
~/notes/components/issue_placeholder_note.vue
'
;
describe
(
'
issue placeholder system note component
'
,
()
=>
{
let
mountComponent
;
beforeEach
(()
=>
{
const
PlaceholderNote
=
Vue
.
extend
(
placeholderNote
);
mountComponent
=
props
=>
new
PlaceholderNote
({
propsData
:
{
note
:
props
,
},
}).
$mount
();
});
describe
(
'
user information
'
,
()
=>
{
it
(
'
should render user avatar with link
'
,
()
=>
{
});
});
describe
(
'
note content
'
,
()
=>
{
it
(
'
should render note header information
'
,
()
=>
{
});
it
(
'
should render note body
'
,
()
=>
{
});
it
(
'
should render system note placeholder with markdown
'
,
()
=>
{
});
it
(
'
should render emojis
'
,
()
=>
{
});
it
(
'
should render slash commands
'
,
()
=>
{
});
});
});
spec/javascripts/notes/components/issue_placeholder_system_note_spec.js
0 → 100644
View file @
7639fb18
import
Vue
from
'
vue
'
;
import
placeholderSystemNote
from
'
~/notes/components/issue_placeholder_system_note.vue
'
;
describe
(
'
issue placeholder system note component
'
,
()
=>
{
let
mountComponent
;
beforeEach
(()
=>
{
const
PlaceholderSystemNote
=
Vue
.
extend
(
placeholderSystemNote
);
mountComponent
=
props
=>
new
PlaceholderSystemNote
({
propsData
:
{
note
:
{
body
:
props
,
},
},
}).
$mount
();
});
it
(
'
should render system note placeholder with plain text
'
,
()
=>
{
const
vm
=
mountComponent
(
'
This is a placeholder
'
);
expect
(
vm
.
$el
.
tagName
).
toEqua
(
'
LI
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.timeline-content i
'
).
textContent
.
trim
()).
toEqua
(
'
This is a placeholder
'
);
});
});
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