Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
1dd0bd4c846e
Unverified
Commit
96944979
authored
Oct 06, 2017
by
Filipa Lacerda
Browse files
Fix typo in cycle analytics breaking time component
parent
6818e49918b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/cycle_analytics/components/total_time_component.vue
View file @
1dd0bd4c
...
...
@@ -20,7 +20,7 @@
<template
v-if=
"time.days"
>
{{
time
.
days
}}
<span>
{{
n__
(
'
day
'
,
'
days
'
,
time
.
days
)
}}
</span></
template
>
<
template
v-if=
"time.hours"
>
{{
time
.
hours
}}
<span>
{{
n__
(
'
Time|hr
'
,
'
Time|hrs
'
,
time
.
hours
)
}}
</span></
template
>
<
template
v-if=
"time.mins && !time.days"
>
{{
time
.
mins
}}
<span>
{{
n__
(
'
Time|min
'
,
'
Time|mins
'
,
time
.
mins
)
}}
</span></
template
>
<
template
v-if=
"time.seconds && hasDa === 1 || time.seconds === 0"
>
{{
time
.
seconds
}}
<span>
{{
s__
(
'
Time|s
'
)
}}
</span></
template
>
<
template
v-if=
"time.seconds && hasDa
ta
=== 1 || time.seconds === 0"
>
{{
time
.
seconds
}}
<span>
{{
s__
(
'
Time|s
'
)
}}
</span></
template
>
</template>
<
template
v-else
>
--
...
...
changelogs/unreleased/fl-fix-ca-time-component.yml
0 → 100644
View file @
1dd0bd4c
---
title
:
Fix typo in cycle analytics breaking time component
merge_request
:
author
:
type
:
fixed
spec/javascripts/cycle_analytics/total_time_component_spec.js
0 → 100644
View file @
1dd0bd4c
import
Vue
from
'
vue
'
;
import
component
from
'
~/cycle_analytics/components/total_time_component.vue
'
;
import
mountComponent
from
'
../helpers/vue_mount_component_helper
'
;
describe
(
'
Total time component
'
,
()
=>
{
let
vm
;
let
Component
;
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
With data
'
,
()
=>
{
it
(
'
should render information for days and hours
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
time
:
{
days
:
3
,
hours
:
4
,
},
});
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'
3 days 4 hrs
'
);
});
it
(
'
should render information for hours and minutes
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
time
:
{
hours
:
4
,
mins
:
35
,
},
});
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'
4 hrs 35 mins
'
);
});
it
(
'
should render information for seconds
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
time
:
{
seconds
:
45
,
},
});
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'
45 s
'
);
});
});
describe
(
'
Without data
'
,
()
=>
{
it
(
'
should render no information
'
,
()
=>
{
vm
=
mountComponent
(
Component
);
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'
--
'
);
});
});
});
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