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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
409a3250
Commit
409a3250
authored
Feb 10, 2017
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace static fixture for behaviors/requires_input_spec.js (!9162)
parent
640e977d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
24 deletions
+11
-24
changelogs/unreleased/requires-input-fixture.yml
changelogs/unreleased/requires-input-fixture.yml
+4
-0
spec/javascripts/behaviors/requires_input_spec.js
spec/javascripts/behaviors/requires_input_spec.js
+7
-6
spec/javascripts/fixtures/behaviors/requires_input.html.haml
spec/javascripts/fixtures/behaviors/requires_input.html.haml
+0
-18
No files found.
changelogs/unreleased/requires-input-fixture.yml
0 → 100644
View file @
409a3250
---
title
:
Replace static fixture for behaviors/requires_input_spec.js
merge_request
:
9162
author
:
winniehell
spec/javascripts/behaviors/requires_input_spec.js
View file @
409a3250
...
...
@@ -4,18 +4,19 @@ require('~/behaviors/requires_input');
(
function
()
{
describe
(
'
requiresInput
'
,
function
()
{
preloadFixtures
(
'
static/behaviors/requires_input
.html.raw
'
);
preloadFixtures
(
'
branches/new_branch
.html.raw
'
);
beforeEach
(
function
()
{
return
loadFixtures
(
'
static/behaviors/requires_input.html.raw
'
);
loadFixtures
(
'
branches/new_branch.html.raw
'
);
this
.
submitButton
=
$
(
'
button[type="submit"]
'
);
});
it
(
'
disables submit when any field is required
'
,
function
()
{
$
(
'
.js-requires-input
'
).
requiresInput
();
return
expect
(
$
(
'
.submit
'
)
).
toBeDisabled
();
return
expect
(
this
.
submitButton
).
toBeDisabled
();
});
it
(
'
enables submit when no field is required
'
,
function
()
{
$
(
'
*[required=required]
'
).
removeAttr
(
'
required
'
);
$
(
'
.js-requires-input
'
).
requiresInput
();
return
expect
(
$
(
'
.submit
'
)
).
not
.
toBeDisabled
();
return
expect
(
this
.
submitButton
).
not
.
toBeDisabled
();
});
it
(
'
enables submit when all required fields are pre-filled
'
,
function
()
{
$
(
'
*[required=required]
'
).
remove
();
...
...
@@ -25,9 +26,9 @@ require('~/behaviors/requires_input');
it
(
'
enables submit when all required fields receive input
'
,
function
()
{
$
(
'
.js-requires-input
'
).
requiresInput
();
$
(
'
#required1
'
).
val
(
'
input1
'
).
change
();
expect
(
$
(
'
.submit
'
)
).
toBeDisabled
();
expect
(
this
.
submitButton
).
toBeDisabled
();
$
(
'
#optional1
'
).
val
(
'
input1
'
).
change
();
expect
(
$
(
'
.submit
'
)
).
toBeDisabled
();
expect
(
this
.
submitButton
).
toBeDisabled
();
$
(
'
#required2
'
).
val
(
'
input2
'
).
change
();
$
(
'
#required3
'
).
val
(
'
input3
'
).
change
();
$
(
'
#required4
'
).
val
(
'
input4
'
).
change
();
...
...
spec/javascripts/fixtures/behaviors/requires_input.html.haml
deleted
100644 → 0
View file @
640e977d
%form
.js-requires-input
%input
{
type:
'text'
,
id:
'required1'
,
required:
'required'
}
%input
{
type:
'text'
,
id:
'required2'
,
required:
'required'
}
%input
{
type:
'text'
,
id:
'required3'
,
required:
'required'
,
value:
'Pre-filled'
}
%input
{
type:
'text'
,
id:
'optional1'
}
%textarea
{
id:
'required4'
,
required:
'required'
}
%textarea
{
id:
'optional2'
}
%select
{
id:
'required5'
,
required:
'required'
}
%option
Zero
%option
{
value:
'1'
}
One
%select
{
id:
'optional3'
,
required:
'required'
}
%option
Zero
%option
{
value:
'1'
}
One
%button
.submit
{
type:
'submit'
,
value:
'Submit'
}
%input
.submit
{
type:
'submit'
,
value:
'Submit'
}
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