BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
556ef5ed
Unverified
Commit
556ef5ed
authored
Oct 10, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec fixes
parent
44d3745e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
24 deletions
+15
-24
gl_field_errors.js
app/assets/javascripts/gl_field_errors.js
+3
-3
notes.js
app/assets/javascripts/notes.js
+2
-2
gl_form_spec.js
spec/javascripts/gl_form_spec.js
+1
-8
notes_spec.js
spec/javascripts/notes_spec.js
+9
-11
No files found.
app/assets/javascripts/gl_field_errors.js
View file @
556ef5ed
...
...
@@ -32,9 +32,9 @@ export default class GlFieldErrors {
const
$form
=
$
(
e
.
currentTarget
);
if
(
!
$form
.
attr
(
'novalidate'
))
{
if
(
!
e
vent
.
currentTarget
.
checkValidity
())
{
e
vent
.
preventDefault
();
e
vent
.
stopPropagation
();
if
(
!
e
.
currentTarget
.
checkValidity
())
{
e
.
preventDefault
();
e
.
stopPropagation
();
}
}
}
...
...
app/assets/javascripts/notes.js
View file @
556ef5ed
...
...
@@ -558,7 +558,7 @@ export default class Notes {
*/
setupNoteForm
(
form
)
{
var
textarea
,
key
;
new
GLForm
(
form
,
this
.
enableGFM
);
this
.
glForm
=
new
GLForm
(
form
,
this
.
enableGFM
);
textarea
=
form
.
find
(
'.js-note-text'
);
key
=
[
'Note'
,
...
...
@@ -1153,7 +1153,7 @@ export default class Notes {
var
targetId
=
$originalContentEl
.
data
(
'target-id'
);
var
targetType
=
$originalContentEl
.
data
(
'target-type'
);
new
GLForm
(
$editForm
.
find
(
'form'
),
this
.
enableGFM
);
this
.
glForm
=
new
GLForm
(
$editForm
.
find
(
'form'
),
this
.
enableGFM
);
$editForm
.
find
(
'form'
)
.
attr
(
'action'
,
postUrl
)
...
...
spec/javascripts/gl_form_spec.js
View file @
556ef5ed
import
autosize
from
'vendor/autosize'
;
import
'~/gl_form'
;
import
GLForm
from
'~/gl_form'
;
import
'~/lib/utils/text_utility'
;
import
'~/lib/utils/common_utils'
;
window
.
autosize
=
autosize
;
describe
(
'GLForm'
,
()
=>
{
const
global
=
window
.
gl
||
(
window
.
gl
=
{});
const
GLForm
=
global
.
GLForm
;
it
(
'should be defined in the global scope'
,
()
=>
{
expect
(
GLForm
).
toBeDefined
();
});
describe
(
'when instantiated'
,
function
()
{
beforeEach
((
done
)
=>
{
this
.
form
=
$
(
'<form class="gfm-form"><textarea class="js-gfm-input"></form>'
);
...
...
spec/javascripts/notes_spec.js
View file @
556ef5ed
...
...
@@ -426,19 +426,17 @@ import '~/notes';
});
describe
(
'putEditFormInPlace'
,
()
=>
{
it
(
'should call gl.GLForm with GFM parameter passed through'
,
()
=>
{
spyOn
(
gl
,
'GLForm'
);
it
(
'should call GLForm with GFM parameter passed through'
,
()
=>
{
const
notes
=
new
Notes
(
''
,
[]);
const
$el
=
$
(
`
<div>
<form></form>
</div>
`
);
const
$el
=
jasmine
.
createSpyObj
(
'$form'
,
[
'find'
,
'closest'
]);
$el
.
find
.
and
.
returnValue
(
$
(
'<div>'
));
$el
.
closest
.
and
.
returnValue
(
$
(
'<div>'
));
notes
.
putEditFormInPlace
(
$el
);
Notes
.
prototype
.
putEditFormInPlace
.
call
({
getEditFormSelector
:
()
=>
''
,
enableGFM
:
true
},
$el
);
expect
(
gl
.
GLForm
).
toHaveBeenCalledWith
(
jasmine
.
any
(
Object
),
true
);
expect
(
notes
.
glForm
.
enableGFM
).
toBeTruthy
();
});
});
...
...
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