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
c17ecc11
Commit
c17ecc11
authored
Mar 13, 2020
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate ee/custom_metrics to Jest
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/194274
parent
f8d715ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
ee/spec/frontend/custom_metrics/components/custom_metrics_form_spec.js
...end/custom_metrics/components/custom_metrics_form_spec.js
+7
-12
No files found.
ee/spec/
javascripts/custom_metric
s/custom_metrics_form_spec.js
→
ee/spec/
frontend/custom_metrics/component
s/custom_metrics_form_spec.js
View file @
c17ecc11
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
CustomMetricsForm
from
'
ee/custom_metrics/components/custom_metrics_form.vue
'
;
const
localVue
=
createLocalVue
();
describe
(
'
CustomMetricsForm
'
,
()
=>
{
let
wrapper
;
...
...
@@ -17,8 +15,7 @@ describe('CustomMetricsForm', () => {
legend
:
''
,
},
})
{
wrapper
=
shallowMount
(
localVue
.
extend
(
CustomMetricsForm
),
{
localVue
,
wrapper
=
shallowMount
(
CustomMetricsForm
,
{
propsData
:
{
customMetricsPath
:
''
,
editProjectServicePath
:
''
,
...
...
@@ -30,24 +27,22 @@ describe('CustomMetricsForm', () => {
}
afterEach
(()
=>
{
if
(
wrapper
)
{
wrapper
.
destroy
();
}
wrapper
.
destroy
();
});
describe
(
'
Computed
'
,
()
=>
{
it
(
'
Form button and title text indicate the custom metric is being edited
'
,
()
=>
{
mountComponent
({
metricPersisted
:
true
});
expect
(
wrapper
.
vm
.
saveButtonText
).
to
Equal
(
'
Save Changes
'
);
expect
(
wrapper
.
vm
.
titleText
).
to
Equal
(
'
Edit metric
'
);
expect
(
wrapper
.
vm
.
saveButtonText
).
to
Be
(
'
Save Changes
'
);
expect
(
wrapper
.
vm
.
titleText
).
to
Be
(
'
Edit metric
'
);
});
it
(
'
Form button and title text indicate the custom metric is being created
'
,
()
=>
{
mountComponent
({
metricPersisted
:
false
});
expect
(
wrapper
.
vm
.
saveButtonText
).
to
Equal
(
'
Create metric
'
);
expect
(
wrapper
.
vm
.
titleText
).
to
Equal
(
'
New metric
'
);
expect
(
wrapper
.
vm
.
saveButtonText
).
to
Be
(
'
Create metric
'
);
expect
(
wrapper
.
vm
.
titleText
).
to
Be
(
'
New metric
'
);
});
});
});
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