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
99862050
Commit
99862050
authored
Nov 29, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create shared timeline entry component
parent
6775dafa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
app/assets/javascripts/vue_shared/components/notes/timeline_entry_item.vue
...ripts/vue_shared/components/notes/timeline_entry_item.vue
+11
-0
spec/javascripts/vue_shared/components/notes/timeline_entry_item_spec.js
...s/vue_shared/components/notes/timeline_entry_item_spec.js
+40
-0
No files found.
app/assets/javascripts/vue_shared/components/notes/timeline_entry_item.vue
0 → 100644
View file @
99862050
<
script
>
export
default
{
name
:
'
TimelineEntry
'
,
};
</
script
>
<
template
>
<li
class=
"timeline-entry"
>
<div
class=
"timeline-entry-inner"
><slot></slot></div>
</li>
</
template
>
spec/javascripts/vue_shared/components/notes/timeline_entry_item_spec.js
0 → 100644
View file @
99862050
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
TimelineEntry
from
'
~/vue_shared/components/notes/timeline_entry.vue
'
;
describe
(
TimelineEntry
.
name
,
()
=>
{
let
wrapper
;
const
factory
=
(
options
=
{})
=>
{
const
localVue
=
createLocalVue
();
wrapper
=
shallowMount
(
TimelineEntry
,
{
localVue
,
...
options
,
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders correctly
'
,
()
=>
{
factory
();
expect
(
wrapper
.
is
(
'
.timeline-entry
'
)).
toBe
(
true
);
expect
(
wrapper
.
contains
(
'
.timeline-entry-inner
'
)).
toBe
(
true
);
});
it
(
'
accepts default slot
'
,
()
=>
{
const
dummyContent
=
'
<p>some content</p>
'
;
factory
({
slots
:
{
default
:
dummyContent
,
},
});
const
content
=
wrapper
.
find
(
'
.timeline-entry-inner :first-child
'
);
expect
(
content
.
html
()).
toBe
(
dummyContent
);
});
});
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