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
b0f3a531
Commit
b0f3a531
authored
Sep 10, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix time_ago test
parent
13516ec0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
spec/frontend/pipelines/time_ago_spec.js
spec/frontend/pipelines/time_ago_spec.js
+16
-7
No files found.
spec/frontend/pipelines/time_ago_spec.js
View file @
b0f3a531
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
TimeAgo
from
'
~/pipelines/components/pipelines_list/time_ago.vue
'
;
describe
(
'
Timeago component
'
,
()
=>
{
...
...
@@ -22,14 +23,19 @@ describe('Timeago component', () => {
wrapper
=
null
;
});
const
duration
=
()
=>
wrapper
.
find
(
'
.duration
'
);
const
finishedAt
=
()
=>
wrapper
.
find
(
'
.finished-at
'
);
describe
(
'
with duration
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
duration
:
10
,
finishedTime
:
''
});
});
it
(
'
should render duration and timer svg
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.duration
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.duration svg
'
).
exists
()).
toBe
(
true
);
const
icon
=
duration
().
find
(
GlIcon
);
expect
(
duration
().
exists
()).
toBe
(
true
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
timer
'
);
});
});
...
...
@@ -39,7 +45,7 @@ describe('Timeago component', () => {
});
it
(
'
should not render duration and timer svg
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.duration
'
).
exists
()).
toBe
(
false
);
expect
(
duration
(
).
exists
()).
toBe
(
false
);
});
});
...
...
@@ -49,9 +55,12 @@ describe('Timeago component', () => {
});
it
(
'
should render time and calendar icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.finished-at
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.finished-at i.fa-calendar
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.finished-at time
'
).
exists
()).
toBe
(
true
);
const
icon
=
finishedAt
().
find
(
GlIcon
);
const
time
=
finishedAt
().
find
(
'
time
'
);
expect
(
finishedAt
().
exists
()).
toBe
(
true
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
calendar
'
);
expect
(
time
.
exists
()).
toBe
(
true
);
});
});
...
...
@@ -61,7 +70,7 @@ describe('Timeago component', () => {
});
it
(
'
should not render time and calendar icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.finished-at
'
).
exists
()).
toBe
(
false
);
expect
(
finishedAt
(
).
exists
()).
toBe
(
false
);
});
});
});
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