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
68cef200
Commit
68cef200
authored
Nov 06, 2020
by
Donald Cook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more test coverage
parent
aaf84be4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
spec/frontend/projects/settings_service_desk/components/service_desk_root_spec.js
...ettings_service_desk/components/service_desk_root_spec.js
+15
-0
spec/frontend/projects/settings_service_desk/components/service_desk_setting_spec.js
...ings_service_desk/components/service_desk_setting_spec.js
+39
-0
No files found.
spec/frontend/projects/settings_service_desk/components/service_desk_root_spec.js
View file @
68cef200
...
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
...
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
ServiceDeskRoot
from
'
~/projects/settings_service_desk/components/service_desk_root.vue
'
;
import
ServiceDeskRoot
from
'
~/projects/settings_service_desk/components/service_desk_root.vue
'
;
import
ServiceDeskSetting
from
'
~/projects/settings_service_desk/components/service_desk_setting.vue
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
...
@@ -162,4 +163,18 @@ describe('ServiceDeskRoot', () => {
...
@@ -162,4 +163,18 @@ describe('ServiceDeskRoot', () => {
expect
(
wrapper
.
html
()).
toContain
(
'
An error occured while making the changes:
'
);
expect
(
wrapper
.
html
()).
toContain
(
'
An error occured while making the changes:
'
);
});
});
});
});
it
(
'
passes customEmail through updatedCustomEmail correctly
'
,
()
=>
{
const
customEmail
=
'
foo
'
;
wrapper
=
mount
(
ServiceDeskRoot
,
{
propsData
:
{
initialIsEnabled
:
true
,
endpoint
,
customEmail
,
},
});
expect
(
wrapper
.
find
(
ServiceDeskSetting
).
props
(
'
customEmail
'
)).
toEqual
(
customEmail
);
});
});
});
spec/frontend/projects/settings_service_desk/components/service_desk_setting_spec.js
View file @
68cef200
...
@@ -85,6 +85,45 @@ describe('ServiceDeskSetting', () => {
...
@@ -85,6 +85,45 @@ describe('ServiceDeskSetting', () => {
});
});
});
});
describe
(
'
with customEmail
'
,
()
=>
{
describe
(
'
customEmail is different than incomingEmail
'
,
()
=>
{
const
incomingEmail
=
'
foo@bar.com
'
;
const
customEmail
=
'
custom@bar.com
'
;
beforeEach
(()
=>
{
wrapper
=
mount
(
ServiceDeskSetting
,
{
propsData
:
{
isEnabled
:
true
,
incomingEmail
,
customEmail
,
},
});
});
it
(
'
should see custom email
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.incoming-email
'
).
element
.
value
).
toEqual
(
customEmail
);
});
});
describe
(
'
customEmail is the same as incomingEmail
'
,
()
=>
{
const
customEmail
=
'
foo@bar.com
'
;
beforeEach
(()
=>
{
wrapper
=
mount
(
ServiceDeskSetting
,
{
propsData
:
{
isEnabled
:
true
,
incomingEmail
:
customEmail
,
customEmail
,
},
});
});
it
(
'
should see custom email
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.incoming-email
'
).
element
.
value
).
toEqual
(
customEmail
);
});
});
});
describe
(
'
templates dropdown
'
,
()
=>
{
describe
(
'
templates dropdown
'
,
()
=>
{
it
(
'
renders a dropdown to choose a template
'
,
()
=>
{
it
(
'
renders a dropdown to choose a template
'
,
()
=>
{
wrapper
=
shallowMount
(
ServiceDeskSetting
,
{
wrapper
=
shallowMount
(
ServiceDeskSetting
,
{
...
...
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