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
e6205a24
Commit
e6205a24
authored
Mar 24, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove manual jquery mocking
- Uses old assertion before jest migration
parent
43805997
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
13 deletions
+2
-13
spec/frontend/blob/blob_file_dropzone_spec.js
spec/frontend/blob/blob_file_dropzone_spec.js
+1
-6
spec/frontend/boards/board_new_issue_spec.js
spec/frontend/boards/board_new_issue_spec.js
+1
-7
No files found.
spec/frontend/blob/blob_file_dropzone_spec.js
View file @
e6205a24
...
@@ -5,10 +5,6 @@ describe('BlobFileDropzone', () => {
...
@@ -5,10 +5,6 @@ describe('BlobFileDropzone', () => {
preloadFixtures
(
'
blob/show.html
'
);
preloadFixtures
(
'
blob/show.html
'
);
let
dropzone
;
let
dropzone
;
let
replaceFileButton
;
let
replaceFileButton
;
const
jQueryMock
=
{
enable
:
jest
.
fn
(),
disable
:
jest
.
fn
(),
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
loadFixtures
(
'
blob/show.html
'
);
loadFixtures
(
'
blob/show.html
'
);
...
@@ -18,7 +14,6 @@ describe('BlobFileDropzone', () => {
...
@@ -18,7 +14,6 @@ describe('BlobFileDropzone', () => {
dropzone
=
$
(
'
.js-upload-blob-form .dropzone
'
).
get
(
0
).
dropzone
;
dropzone
=
$
(
'
.js-upload-blob-form .dropzone
'
).
get
(
0
).
dropzone
;
dropzone
.
processQueue
=
jest
.
fn
();
dropzone
.
processQueue
=
jest
.
fn
();
replaceFileButton
=
$
(
'
#submit-all
'
);
replaceFileButton
=
$
(
'
#submit-all
'
);
$
.
fn
.
extend
(
jQueryMock
);
});
});
describe
(
'
submit button
'
,
()
=>
{
describe
(
'
submit button
'
,
()
=>
{
...
@@ -43,7 +38,7 @@ describe('BlobFileDropzone', () => {
...
@@ -43,7 +38,7 @@ describe('BlobFileDropzone', () => {
replaceFileButton
.
click
();
replaceFileButton
.
click
();
expect
(
window
.
alert
).
not
.
toHaveBeenCalled
();
expect
(
window
.
alert
).
not
.
toHaveBeenCalled
();
expect
(
jQueryMock
.
enable
).
toHaveBeenCalled
(
);
expect
(
replaceFileButton
.
is
(
'
:disabled
'
)).
toEqual
(
true
);
expect
(
dropzone
.
processQueue
).
toHaveBeenCalled
();
expect
(
dropzone
.
processQueue
).
toHaveBeenCalled
();
});
});
});
});
...
...
spec/frontend/boards/board_new_issue_spec.js
View file @
e6205a24
/* global List */
/* global List */
import
$
from
'
jquery
'
;
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
...
@@ -15,9 +14,6 @@ describe('Issue boards new issue form', () => {
...
@@ -15,9 +14,6 @@ describe('Issue boards new issue form', () => {
let
list
;
let
list
;
let
mock
;
let
mock
;
let
newIssueMock
;
let
newIssueMock
;
const
jQueryMock
=
{
enable
:
jest
.
fn
(),
};
const
promiseReturn
=
{
const
promiseReturn
=
{
data
:
{
data
:
{
iid
:
100
,
iid
:
100
,
...
@@ -53,8 +49,6 @@ describe('Issue boards new issue form', () => {
...
@@ -53,8 +49,6 @@ describe('Issue boards new issue form', () => {
},
},
}).
$mount
(
document
.
querySelector
(
'
.test-container
'
));
}).
$mount
(
document
.
querySelector
(
'
.test-container
'
));
$
.
fn
.
extend
(
jQueryMock
);
return
Vue
.
nextTick
();
return
Vue
.
nextTick
();
});
});
...
@@ -118,7 +112,7 @@ describe('Issue boards new issue form', () => {
...
@@ -118,7 +112,7 @@ describe('Issue boards new issue form', () => {
return
Vue
.
nextTick
()
return
Vue
.
nextTick
()
.
then
(
submitIssue
)
.
then
(
submitIssue
)
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
jQueryMock
.
enable
).
toHaveBeenCalled
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
disabled
).
toBe
(
false
);
});
});
});
});
...
...
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