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
1fc10388
Commit
1fc10388
authored
May 14, 2021
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor validation spec by caching object
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/330691
parent
7368e2a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
spec/frontend/vue_shared/directives/validation_spec.js
spec/frontend/vue_shared/directives/validation_spec.js
+8
-12
No files found.
spec/frontend/vue_shared/directives/validation_spec.js
View file @
1fc10388
...
...
@@ -240,14 +240,16 @@ describe('initForm', () => {
},
};
const
EXPECTED_FIELDS
=
{
name
:
{
value
:
'
lorem
'
,
required
:
true
,
state
:
null
,
feedback
:
null
},
description
:
{
value
:
'
ipsum
'
,
required
:
false
,
state
:
true
,
feedback
:
null
},
};
it
(
'
returns form object
'
,
()
=>
{
expect
(
initForm
(
MOCK_FORM
)).
toMatchObject
({
state
:
false
,
showValidation
:
false
,
fields
:
{
name
:
{
value
:
'
lorem
'
,
required
:
true
,
state
:
null
,
feedback
:
null
},
description
:
{
value
:
'
ipsum
'
,
required
:
false
,
state
:
true
,
feedback
:
null
},
},
fields
:
EXPECTED_FIELDS
,
});
});
...
...
@@ -266,10 +268,7 @@ describe('initForm', () => {
expect
(
initForm
(
form
)).
toMatchObject
({
state
:
false
,
showValidation
:
false
,
fields
:
{
name
:
{
value
:
'
lorem
'
,
required
:
true
,
state
:
null
,
feedback
:
null
},
description
:
{
value
:
'
ipsum
'
,
required
:
false
,
state
:
true
,
feedback
:
null
},
},
fields
:
EXPECTED_FIELDS
,
...
customFormObject
,
});
});
...
...
@@ -284,10 +283,7 @@ describe('initForm', () => {
expect
(
initForm
(
form
)).
toMatchObject
({
state
:
true
,
showValidation
:
true
,
fields
:
{
name
:
{
value
:
'
lorem
'
,
required
:
true
,
state
:
null
,
feedback
:
null
},
description
:
{
value
:
'
ipsum
'
,
required
:
false
,
state
:
true
,
feedback
:
null
},
},
fields
:
EXPECTED_FIELDS
,
});
});
});
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