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
59353a45
Commit
59353a45
authored
Jan 14, 2022
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer feedback
- remove _form.haml_spec - use testid for test selector
parent
fa7dbdb8
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
39 deletions
+17
-39
app/views/projects/services/_form.html.haml
app/views/projects/services/_form.html.haml
+1
-1
app/views/shared/_integration_settings.html.haml
app/views/shared/_integration_settings.html.haml
+1
-1
app/views/shared/integrations/_form.html.haml
app/views/shared/integrations/_form.html.haml
+0
-3
app/views/shared/integrations/edit.html.haml
app/views/shared/integrations/edit.html.haml
+1
-1
ee/spec/features/projects/settings/slack_application_spec.rb
ee/spec/features/projects/settings/slack_application_spec.rb
+2
-2
spec/features/projects/integrations/user_activates_jira_spec.rb
...eatures/projects/integrations/user_activates_jira_spec.rb
+1
-1
spec/frontend/integrations/edit/components/integration_form_spec.js
...end/integrations/edit/components/integration_form_spec.js
+10
-2
spec/helpers/integrations_helper_spec.rb
spec/helpers/integrations_helper_spec.rb
+1
-0
spec/views/projects/services/_form.haml_spec.rb
spec/views/projects/services/_form.haml_spec.rb
+0
-28
No files found.
app/views/projects/services/_form.html.haml
View file @
59353a45
...
...
@@ -6,7 +6,7 @@
-
if
integration
.
operating?
=
sprite_icon
(
'check'
,
css_class:
'gl-text-green-500'
)
=
render
'shared/
service
_settings'
,
integration:
integration
=
render
'shared/
integration
_settings'
,
integration:
integration
-
if
lookup_context
.
template_exists?
(
'show'
,
"projects/services/
#{
integration
.
to_param
}
"
,
true
)
%hr
=
render
"projects/services/
#{
integration
.
to_param
}
/show"
,
integration:
integration
app/views/shared/_
service
_settings.html.haml
→
app/views/shared/_
integration
_settings.html.haml
View file @
59353a45
=
form_errors
(
integration
)
.service-settings
%div
{
data:
{
testid:
"integration-settings-form"
}
}
-
if
@default_integration
.js-vue-default-integration-settings
{
data:
integration_form_data
(
@default_integration
,
group:
@group
,
project:
@project
)
}
.js-vue-integration-settings
{
data:
integration_form_data
(
integration
,
group:
@group
,
project:
@project
)
}
...
...
app/views/shared/integrations/_form.html.haml
deleted
100644 → 0
View file @
fa7dbdb8
-
integration
=
local_assigns
.
fetch
(
:integration
)
=
render
'shared/service_settings'
,
integration:
integration
app/views/shared/integrations/edit.html.haml
View file @
59353a45
...
...
@@ -7,4 +7,4 @@
=
@integration
.
title
=
render
'shared/integrations/tabs'
,
integration:
@integration
,
active_tab:
'edit'
do
=
render
'shared/integration
s/form
'
,
integration:
@integration
=
render
'shared/integration
_settings
'
,
integration:
@integration
ee/spec/features/projects/settings/slack_application_spec.rb
View file @
59353a45
...
...
@@ -22,7 +22,7 @@ RSpec.describe 'Slack application' do
it
'I can edit slack integration'
do
visit
slack_application_form_path
within
'
.service-settings
'
do
within
'
[data-testid="integration-settings-form"]
'
do
click_link
'Edit'
end
...
...
@@ -31,7 +31,7 @@ RSpec.describe 'Slack application' do
expect
(
page
).
to
have_content
(
'The project alias was updated successfully'
)
within
'
.service-settings
'
do
within
'
[data-testid="integration-settings-form"]
'
do
expect
(
page
).
to
have_content
(
'alias-edited'
)
end
end
...
...
spec/features/projects/integrations/user_activates_jira_spec.rb
View file @
59353a45
...
...
@@ -41,7 +41,7 @@ RSpec.describe 'User activates Jira', :js do
fill_in
'service_password'
,
with:
'password'
click_test_integration
page
.
within
(
'
.service-settings
'
)
do
page
.
within
(
'
[data-testid="integration-settings-form"]
'
)
do
expect
(
page
).
to
have_content
(
'This field is required.'
)
end
end
...
...
spec/frontend/integrations/edit/components/integration_form_spec.js
View file @
59353a45
...
...
@@ -3,7 +3,7 @@ import axios from 'axios';
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
setHTMLFixture
}
from
'
helpers/fixtures
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
mountExtended
,
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
ActiveCheckbox
from
'
~/integrations/edit/components/active_checkbox.vue
'
;
import
ConfirmationModal
from
'
~/integrations/edit/components/confirmation_modal.vue
'
;
...
...
@@ -42,6 +42,7 @@ describe('IntegrationForm', () => {
featureFlags
=
{},
initialState
=
{},
props
=
{},
mountFn
=
shallowMountExtended
,
}
=
{})
=>
{
const
store
=
createStore
({
customState
:
{
...
mockIntegrationProps
,
...
customStateProps
},
...
...
@@ -49,7 +50,7 @@ describe('IntegrationForm', () => {
});
dispatch
=
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
wrapper
=
mount
Extended
(
IntegrationForm
,
{
wrapper
=
mount
Fn
(
IntegrationForm
,
{
propsData
:
{
...
props
,
formSelector
:
'
.test
'
},
provide
:
{
glFeatures
:
featureFlags
,
...
...
@@ -218,6 +219,7 @@ describe('IntegrationForm', () => {
createComponent
({
customStateProps
:
{
type
:
'
jira
'
,
testPath
:
'
/test
'
},
mountFn
:
mountExtended
,
});
});
...
...
@@ -378,6 +380,7 @@ describe('IntegrationForm', () => {
showActive
:
true
,
initialActivated
:
false
,
},
mountFn
:
mountExtended
,
});
await
findActiveCheckbox
().
vm
.
$emit
(
'
toggle-integration-active
'
,
formActive
);
...
...
@@ -399,6 +402,7 @@ describe('IntegrationForm', () => {
canTest
:
true
,
initialActivated
:
true
,
},
mountFn
:
mountExtended
,
});
await
findProjectSaveButton
().
vm
.
$emit
(
'
click
'
,
new
Event
(
'
click
'
));
...
...
@@ -428,6 +432,7 @@ describe('IntegrationForm', () => {
canTest
:
true
,
initialActivated
:
integrationActive
,
},
mountFn
:
mountExtended
,
});
jest
.
spyOn
(
findGlForm
().
element
,
'
submit
'
);
jest
.
spyOn
(
findGlForm
().
element
,
'
checkValidity
'
).
mockReturnValue
(
checkValidityReturn
);
...
...
@@ -449,6 +454,7 @@ describe('IntegrationForm', () => {
canTest
:
true
,
initialActivated
:
true
,
},
mountFn
:
mountExtended
,
});
jest
.
spyOn
(
findGlForm
().
element
,
'
submit
'
);
jest
.
spyOn
(
findGlForm
().
element
,
'
checkValidity
'
).
mockReturnValue
(
false
);
...
...
@@ -482,6 +488,7 @@ describe('IntegrationForm', () => {
showActive
:
true
,
canTest
:
true
,
},
mountFn
:
mountExtended
,
});
jest
.
spyOn
(
findGlForm
().
element
,
'
checkValidity
'
).
mockReturnValue
(
false
);
...
...
@@ -501,6 +508,7 @@ describe('IntegrationForm', () => {
canTest
:
true
,
testPath
:
mockTestPath
,
},
mountFn
:
mountExtended
,
});
jest
.
spyOn
(
findGlForm
().
element
,
'
checkValidity
'
).
mockReturnValue
(
true
);
});
...
...
spec/helpers/integrations_helper_spec.rb
View file @
59353a45
...
...
@@ -46,6 +46,7 @@ RSpec.describe IntegrationsHelper do
:can_test
,
:test_path
,
:reset_path
,
:form_path
,
:redirect_to
]
end
...
...
spec/views/projects/services/_form.haml_spec.rb
deleted
100644 → 0
View file @
fa7dbdb8
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'projects/services/_form'
do
let
(
:project
)
{
create
(
:redmine_project
)
}
let
(
:user
)
{
create
(
:admin
)
}
before
do
assign
(
:project
,
project
)
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive_messages
(
current_user:
user
,
can?:
true
,
current_application_settings:
Gitlab
::
CurrentSettings
.
current_application_settings
,
integration:
project
.
redmine_integration
,
request:
double
(
referer:
'/services'
)
)
end
context
'commit_events and merge_request_events'
do
it
'display merge_request_events and commit_events descriptions'
do
allow
(
Integrations
::
Redmine
).
to
receive
(
:supported_events
).
and_return
(
%w(commit merge_request)
)
end
end
end
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