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
6725cb1f
Commit
6725cb1f
authored
Aug 16, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update remaining unit tests
* Update unti tests to account for component refactor
parent
d9739651
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
36 deletions
+33
-36
ee/app/assets/javascripts/approvals/stores/index.js
ee/app/assets/javascripts/approvals/stores/index.js
+1
-1
ee/spec/frontend/approvals/components/project_settings/project_rules_spec.js
...provals/components/project_settings/project_rules_spec.js
+27
-3
ee/spec/frontend/approvals/components/rule_form_spec.js
ee/spec/frontend/approvals/components/rule_form_spec.js
+3
-3
ee/spec/frontend/security_configuration/modules/configuration/actions_spec.js
...urity_configuration/modules/configuration/actions_spec.js
+2
-20
ee/spec/frontend/security_configuration/modules/configuration/mutation_spec.js
...rity_configuration/modules/configuration/mutation_spec.js
+0
-9
No files found.
ee/app/assets/javascripts/approvals/stores/index.js
View file @
6725cb1f
...
@@ -10,7 +10,7 @@ export const createStoreOptions = (approvalsModule, settings) => ({
...
@@ -10,7 +10,7 @@ export const createStoreOptions = (approvalsModule, settings) => ({
createModal
:
modalModule
(),
createModal
:
modalModule
(),
deleteModal
:
modalModule
(),
deleteModal
:
modalModule
(),
securityConfiguration
:
securityConfigurationModule
({
securityConfiguration
:
securityConfigurationModule
({
securityConfigurationPath
:
settings
.
securityConfigurationPath
,
securityConfigurationPath
:
settings
?.
securityConfigurationPath
||
''
,
}),
}),
},
},
});
});
...
...
ee/spec/frontend/approvals/components/project_settings/project_rules_spec.js
View file @
6725cb1f
...
@@ -5,7 +5,7 @@ import projectSettingsModule from 'ee/approvals/stores/modules/project_settings'
...
@@ -5,7 +5,7 @@ import projectSettingsModule from 'ee/approvals/stores/modules/project_settings'
import
ProjectRules
from
'
ee/approvals/components/project_settings/project_rules.vue
'
;
import
ProjectRules
from
'
ee/approvals/components/project_settings/project_rules.vue
'
;
import
RuleInput
from
'
ee/approvals/components/mr_edit/rule_input.vue
'
;
import
RuleInput
from
'
ee/approvals/components/mr_edit/rule_input.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UnconfiguredSecurityRule
from
'
ee/approvals/components/security_configuration/unconfigured_security_rule
.vue
'
;
import
UnconfiguredSecurityRule
s
from
'
ee/approvals/components/security_configuration/unconfigured_security_rules
.vue
'
;
import
{
createProjectRules
}
from
'
../../mocks
'
;
import
{
createProjectRules
}
from
'
../../mocks
'
;
const
TEST_RULES
=
createProjectRules
();
const
TEST_RULES
=
createProjectRules
();
...
@@ -125,7 +125,7 @@ describe('Approvals ProjectRules', () => {
...
@@ -125,7 +125,7 @@ describe('Approvals ProjectRules', () => {
});
});
it
(
'
should not render the unconfigured-security-rule component
'
,
()
=>
{
it
(
'
should not render the unconfigured-security-rule component
'
,
()
=>
{
expect
(
wrapper
.
contains
(
UnconfiguredSecurityRule
)).
toBe
(
false
);
expect
(
wrapper
.
contains
(
UnconfiguredSecurityRule
s
)).
toBe
(
false
);
});
});
});
});
...
@@ -149,7 +149,31 @@ describe('Approvals ProjectRules', () => {
...
@@ -149,7 +149,31 @@ describe('Approvals ProjectRules', () => {
});
});
it
(
'
should render the unconfigured-security-rule component
'
,
()
=>
{
it
(
'
should render the unconfigured-security-rule component
'
,
()
=>
{
expect
(
wrapper
.
contains
(
UnconfiguredSecurityRule
)).
toBe
(
true
);
expect
(
wrapper
.
contains
(
UnconfiguredSecurityRules
)).
toBe
(
true
);
});
});
describe
(
'
when the approvalSuggestions feature flag is disabled
'
,
()
=>
{
beforeEach
(()
=>
{
const
rules
=
createProjectRules
();
rules
[
0
].
name
=
'
Vulnerability-Check
'
;
store
.
modules
.
approvals
.
state
.
rules
=
rules
;
store
.
state
.
settings
.
allowMultiRule
=
true
;
});
beforeEach
(()
=>
{
factory
(
{},
{
provide
:
{
glFeatures
:
{
approvalSuggestions
:
false
},
},
},
);
});
it
(
'
should notrender the unconfigured-security-rule component
'
,
()
=>
{
expect
(
wrapper
.
contains
(
UnconfiguredSecurityRules
)).
toBe
(
false
);
});
});
});
});
});
});
ee/spec/frontend/approvals/components/rule_form_spec.js
View file @
6725cb1f
...
@@ -488,7 +488,7 @@ describe('EE Approvals RuleForm', () => {
...
@@ -488,7 +488,7 @@ describe('EE Approvals RuleForm', () => {
createComponent
(
createComponent
(
{
{
initRule
:
null
,
initRule
:
null
,
initRuleField
Name
:
'
Vulnerability-Check
'
,
defaultRule
Name
:
'
Vulnerability-Check
'
,
},
},
{
{
provide
:
{
provide
:
{
...
@@ -508,7 +508,7 @@ describe('EE Approvals RuleForm', () => {
...
@@ -508,7 +508,7 @@ describe('EE Approvals RuleForm', () => {
createComponent
(
createComponent
(
{
{
initRule
:
null
,
initRule
:
null
,
initRuleField
Name
:
'
License-Check
'
,
defaultRule
Name
:
'
License-Check
'
,
},
},
{
{
provide
:
{
provide
:
{
...
@@ -528,7 +528,7 @@ describe('EE Approvals RuleForm', () => {
...
@@ -528,7 +528,7 @@ describe('EE Approvals RuleForm', () => {
createComponent
(
createComponent
(
{
{
initRule
:
null
,
initRule
:
null
,
initRuleField
Name
:
'
Foo Bar Baz
'
,
defaultRule
Name
:
'
Foo Bar Baz
'
,
},
},
{
{
provide
:
{
provide
:
{
...
...
ee/spec/frontend/security_configuration/modules/configuration/actions_spec.js
View file @
6725cb1f
...
@@ -11,25 +11,8 @@ describe('security configuration module actions', () => {
...
@@ -11,25 +11,8 @@ describe('security configuration module actions', () => {
let
state
;
let
state
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
state
=
createState
();
state
=
createState
({
});
securityConfigurationPath
:
`
${
TEST_HOST
}
/-/security/configuration.json`
,
describe
(
'
setSecurityConfigurationEndpoint
'
,
()
=>
{
const
securityConfigurationPath
=
123
;
it
(
'
should commit the SET_SECURITY_CONFIGURATION_ENDPOINT mutation
'
,
async
()
=>
{
await
testAction
(
actions
.
setSecurityConfigurationEndpoint
,
securityConfigurationPath
,
state
,
[
{
type
:
types
.
SET_SECURITY_CONFIGURATION_ENDPOINT
,
payload
:
securityConfigurationPath
,
},
],
[],
);
});
});
});
});
...
@@ -38,7 +21,6 @@ describe('security configuration module actions', () => {
...
@@ -38,7 +21,6 @@ describe('security configuration module actions', () => {
const
configuration
=
{};
const
configuration
=
{};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
state
.
securityConfigurationPath
=
`
${
TEST_HOST
}
/-/security/configuration.json`
;
mock
=
new
MockAdapter
(
axios
);
mock
=
new
MockAdapter
(
axios
);
});
});
...
...
ee/spec/frontend/security_configuration/modules/configuration/mutation_spec.js
View file @
6725cb1f
...
@@ -8,15 +8,6 @@ describe('security configuration module mutations', () => {
...
@@ -8,15 +8,6 @@ describe('security configuration module mutations', () => {
state
=
{};
state
=
{};
});
});
describe
(
'
SET_SECURITY_CONFIGURATION_ENDPOINT
'
,
()
=>
{
const
securityConfigurationPath
=
123
;
it
(
`should set the securityConfigurationPath to
${
securityConfigurationPath
}
`
,
()
=>
{
mutations
[
types
.
SET_SECURITY_CONFIGURATION_ENDPOINT
](
state
,
securityConfigurationPath
);
expect
(
state
.
securityConfigurationPath
).
toBe
(
securityConfigurationPath
);
});
});
describe
(
'
REQUEST_SECURITY_CONFIGURATION
'
,
()
=>
{
describe
(
'
REQUEST_SECURITY_CONFIGURATION
'
,
()
=>
{
it
(
'
should set the isLoading to true
'
,
()
=>
{
it
(
'
should set the isLoading to true
'
,
()
=>
{
mutations
[
types
.
REQUEST_SECURITY_CONFIGURATION
](
state
);
mutations
[
types
.
REQUEST_SECURITY_CONFIGURATION
](
state
);
...
...
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