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
Boxiang Sun
gitlab-ce
Commits
128d8b61
Commit
128d8b61
authored
Feb 09, 2017
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace static fixture for behaviors/quick_submit_spec.js (!9086)
parent
d4317e4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
changelogs/unreleased/quick-submit-fixture.yml
changelogs/unreleased/quick-submit-fixture.yml
+4
-0
spec/javascripts/behaviors/quick_submit_spec.js
spec/javascripts/behaviors/quick_submit_spec.js
+13
-5
spec/javascripts/fixtures/behaviors/quick_submit.html.haml
spec/javascripts/fixtures/behaviors/quick_submit.html.haml
+0
-5
No files found.
changelogs/unreleased/quick-submit-fixture.yml
0 → 100644
View file @
128d8b61
---
title
:
Replace static fixture for behaviors/quick_submit_spec.js
merge_request
:
9086
author
:
winniehell
spec/javascripts/behaviors/quick_submit_spec.js
View file @
128d8b61
...
...
@@ -5,9 +5,9 @@ require('~/behaviors/quick_submit');
(
function
()
{
describe
(
'
Quick Submit behavior
'
,
function
()
{
var
keydownEvent
;
preloadFixtures
(
'
static/behaviors/quick_submit
.html.raw
'
);
preloadFixtures
(
'
issues/open-issue
.html.raw
'
);
beforeEach
(
function
()
{
loadFixtures
(
'
static/behaviors/quick_submit
.html.raw
'
);
loadFixtures
(
'
issues/open-issue
.html.raw
'
);
$
(
'
form
'
).
submit
(
function
(
e
)
{
// Prevent a form submit from moving us off the testing page
return
e
.
preventDefault
();
...
...
@@ -37,10 +37,18 @@ require('~/behaviors/quick_submit');
}));
return
expect
(
this
.
spies
.
submit
).
not
.
toHaveBeenTriggered
();
});
it
(
'
disables submit buttons
'
,
function
()
{
it
(
'
disables input of type submit
'
,
function
()
{
const
submitButton
=
$
(
'
.js-quick-submit input[type=submit]
'
);
this
.
textarea
.
trigger
(
keydownEvent
());
expect
(
$
(
'
input[type=submit]
'
)).
toBeDisabled
();
return
expect
(
$
(
'
button[type=submit]
'
)).
toBeDisabled
();
expect
(
submitButton
).
toBeDisabled
();
});
it
(
'
disables button of type submit
'
,
function
()
{
// button doesn't exist in fixture, add it manually
const
submitButton
=
$
(
'
<button type="submit">Submit it</button>
'
);
submitButton
.
insertAfter
(
this
.
textarea
);
this
.
textarea
.
trigger
(
keydownEvent
());
expect
(
submitButton
).
toBeDisabled
();
});
// We cannot stub `navigator.userAgent` for CI's `rake karma` task, so we'll
// only run the tests that apply to the current platform
...
...
spec/javascripts/fixtures/behaviors/quick_submit.html.haml
deleted
100644 → 0
View file @
d4317e4d
%form
.js-quick-submit
{
action:
'/foo'
}
%textarea
%input
{
type:
'submit'
}
Submit
%button
.btn
{
type:
'submit'
}
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